[READ-ONLY] Mirror of https://github.com/probablykasper/deep-filter. pypi.org/project/deep-filter
package
0

Configure Feed

Select the types of activity you want to include in your feed.

Add dev instructions

Kasper (Sep 5, 2020, 9:40 PM +0200) de1dd431 012ae53c

+40 -3
+40 -3
README.md
··· 1 1 # deep-filter 2 2 A simple package that filters out values from dicts/lists, including all dicts/lists nested within it. 3 3 4 - # Usage 4 + ## Usage 5 5 ```python 6 6 from deep_filter import deep_filter 7 7 x = { ··· 19 19 # {'yep': [{}, 99]} 20 20 ``` 21 21 22 - #### deep_filter(dict_or_list, filter_func=default_filter_func) 22 + ### deep_filter(dict_or_list, filter_func=default_filter_func) 23 23 - **dict_or_list**: A dictionary or list 24 24 - **filter_func**: An optional callback function. It will take a value as an argument, and return `True` if the value will be kept and `False` if not. If omitted, `None` values will be filtered out. 25 25 26 - Returns your dict or list, filtered. 26 + Returns your dict or list, filtered. 27 + 28 + ## Dev instructions 29 + 30 + ### Get started 31 + 32 + 1. Install Python (Python 3.7 works, probably other versions too) 33 + 2. Install [Poetry](https://poetry.eustace.io). Poetry is used to manage dependencies, the virtual environment and publishing to PyPI 34 + 3. Run `poetry install` to install Python package dependencies 35 + 36 + I recommend running `poetry config virtualenvs.in-project true`, which makes Poetry store your Python virtual environment inside the project folder. Additionally, it lets VSCode's Python extension detect the virtual environment if you set the `python.pythonPath` setting to `${workspaceFolder}/.venv/bin/python` in your settings. 37 + 38 + ### Running 39 + 40 + To test if things work, you can run the following command to open the Python REPL. Then you can write Python, such as the usage examples: 41 + 42 + ``` 43 + poetry run python 44 + ``` 45 + 46 + ### Releasing a new version 47 + 48 + 1. Consider updating the lockfile by running `poetry update`, then check if thing still work 49 + 2. Bump the version number: 50 + ``` 51 + poetry version <version> 52 + ``` 53 + 3. Update `CHANGELOG.md` 54 + 4. Build: 55 + ``` 56 + poetry build 57 + ``` 58 + 5. Commit and create git tag 59 + 6. Create GitHub release with release notes and attach the build files 60 + 7. Publish to PyPi: 61 + ``` 62 + poetry publish 63 + ```