Skip to main content

Dataset Generate CLI

Project description

Python 3.8 Poetry 1.0.10

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

standard-version

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


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.2.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

nwt_dataset_cli-1.2.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file nwt_dataset_cli-1.2.0.tar.gz.

File metadata

  • Download URL: nwt_dataset_cli-1.2.0.tar.gz
  • Upload date:
  • Size: 10.3 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

Hashes for nwt_dataset_cli-1.2.0.tar.gz
Algorithm Hash digest
SHA256 6026f95643f436589583cd3e68383de6795f4a7c997a87ded6557e9b5d03c0b1
MD5 2631fb4450dc0c624a17df97c739d9ae
BLAKE2b-256 563679a9d5321492dd3712e1235038d8eb59a2ea9f4214e28bb0e54c8546c0e2

See more details on using hashes here.

File details

Details for the file nwt_dataset_cli-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: nwt_dataset_cli-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 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

Hashes for nwt_dataset_cli-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb84d3342846a642741ad0ee310ea81829b8233266fa9f71753a897c5cbe0993
MD5 5bc83d8dee2863fc7526debad532fc76
BLAKE2b-256 fc8a292d7dcd1ea05a92b92be1a7217507162d9b61954b126ef0cca46275d804

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page