Dataset Generate CLI
Project description
dataset-cli
Getting started
This project uses:
- poetry as dependency manager
- mypy for static typing analysis
- black for code formatting
- flake8 for linting
- pytest as testing framework
- coverage for code coverage reporting
- pre-commit to setup git hooks (formatting and linting before commits)
# Clone the repository
git clone git@bitbucket.org:newtralmedia/dataset-cli-lib
# Install the dependencies using poetry
poetry install
# Enable virtual environment
poetry shell
# Setup pre commit hooks
poetry run pre-commit install
poetry run pre-commit run --all-files
# If you need create a tunel ssh to connect to remote mongo
ssh -i key.pem user@remotehost -L 27017:localhost:27017 -N
Cli Commands
# Commands
create Create a dataset with custom parameters.
fromjson Create a dataset from json file.
# Show all options for command
python dataset_cli/app.py create --help
python dataset_cli/app.py fromjson --help
# Create dateset from cli
python dataset_cli/app.py create --start 2018-09-24 --target fact --source slack --random 123
# Create dateset from json
python dataset_cli/app.py fromjson --file xxxxxx.json
# Custom mongo uri
python dataset_cli/app.py fromjson --mongo mongodb://remote_host:27017 --file xxxxxxx.json
# Folder to export dataset
python dataset_cli/app.py create --target fact --source editor --random 123 --folder my_folder
Release
In order to generate a new release you will need:
Node LTS
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm install lts # You may need to open a new shell
npm install --global standard-version
Just run the following script. It will:
- Checkout to master
- Merge the most recent develop changes
- Update package version and create a new tag
- Push changes to master and develop
./scripts/release
Test
Run every tests
poetry run pytest
Coverage
Run tests and generate a code coverage report
poetry run coverage run -m pytest
poetry run coverage report -m
# Remove a previously generated coverage reports
poetry run coverage erase
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nwt_dataset_cli-1.1.0.tar.gz
(10.4 kB
view details)
Built Distribution
File details
Details for the file nwt_dataset_cli-1.1.0.tar.gz
.
File metadata
- Download URL: nwt_dataset_cli-1.1.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.0 CPython/3.8.0 Linux/4.15.0-128-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca23554f27aca8e79e209484c4d0d268d4374bad91a83313b2a50b94c4f60ed1 |
|
MD5 | 6a65d8654f764d7c5ab8e6e67c507a1d |
|
BLAKE2b-256 | 2386ade79c9427d53016289a0b373492ac999092eafc795273aa1b7996d76b4a |
File details
Details for the file nwt_dataset_cli-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: nwt_dataset_cli-1.1.0-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.0 CPython/3.8.0 Linux/4.15.0-128-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4e223c1f2b29f52d8c68994ef48fc0727cc34c34207f8f21c06c1504df4df11 |
|
MD5 | 5d742756f1772dd34a0e11ae7ea94ace |
|
BLAKE2b-256 | d11d8c06736f22b9c990cc55c557cccd2bb871396a094b46a8ff48e30d7b76ca |