{"id":13566024,"url":"https://github.com/okp4/data-selector","last_synced_at":"2025-04-03T23:30:51.413Z","repository":{"id":62380907,"uuid":"517997457","full_name":"okp4/data-selector","owner":"okp4","description":"Select (or filter) data of different types and in multiple dimensions.","archived":false,"fork":false,"pushed_at":"2024-03-27T20:05:21.000Z","size":301,"stargazers_count":4,"open_issues_count":13,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-04T19:42:31.523Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okp4.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-26T09:32:32.000Z","updated_at":"2023-03-18T19:44:06.000Z","dependencies_parsed_at":"2024-01-19T07:05:53.643Z","dependency_job_id":"fce73576-4f9d-411f-9b8f-e34ed63275a8","html_url":"https://github.com/okp4/data-selector","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"okp4/template-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fdata-selector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fdata-selector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fdata-selector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okp4%2Fdata-selector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okp4","download_url":"https://codeload.github.com/okp4/data-selector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097640,"owners_count":20883122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:00.305Z","updated_at":"2025-04-03T23:30:50.474Z","avatar_url":"https://github.com/okp4.png","language":"Python","readme":"# Data Selector\n\n\u003e Tool to select or filter data of different types and in multiple dimensions.\n\n[![version](https://img.shields.io/github/v/release/okp4/data-selector?style=for-the-badge\u0026logo=github)](https://github.com/okp4/data-selector/releases)\n[![lint](https://img.shields.io/github/actions/workflow/status/okp4/data-selector/lint.yml?branch=main\u0026label=lint\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/data-selector/actions/workflows/lint.yml)\n[![build](https://img.shields.io/github/actions/workflow/status/okp4/data-selector/build.yml?branch=main\u0026label=build\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/data-selector/actions/workflows/build.yml)\n[![test](https://img.shields.io/github/actions/workflow/status/okp4/data-selector/test.yml?branch=main\u0026label=test\u0026style=for-the-badge\u0026logo=github)](https://github.com/okp4/data-selector/actions/workflows/test.yml)\n[![codecov](https://img.shields.io/codecov/c/github/okp4/data-selector?style=for-the-badge\u0026logo=codecov)](https://codecov.io/gh/okp4/data-selector)\n[![conventional commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge\u0026logo=conventionalcommits)](https://conventionalcommits.org)\n[![contributor covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge)](https://github.com/okp4/.github/blob/main/CODE_OF_CONDUCT.md)\n[![License](https://img.shields.io/badge/License-BSD_3--Clause-blue.svg?style=for-the-badge)](https://opensource.org/licenses/BSD-3-Clause)\n\n## Purpose\n\nThe `Data Selector` tool allows you to select a sample of the dataset, specifying a number of rows. It is possible to delete or keep columns. Another parameter allows the selection of data in a column according to its value(s).\n\nThe output result is saved in a `.csv` file.\n\n## Usage\n\nThe usage is given as follows:\n\n```sh\nUsage: data-selector [OPTIONS] COMMAND [ARGS]...\n\n  Data selection interactive tool.\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  selector  Tool to select Data to Keep/Delete\n  version   Print the application version information\n```\n\nTo use the command to select data in file:\n\n```sh\nUsage: data-selector selector [OPTIONS]\n\n  Tool to select Data to Keep/Delete\n\nOptions:\n  -i, --input FILE                Data file to convert  [required]\n  -out, --output TEXT             name for the output files  [required]\n  -f, --force                     Overwrite existing files\n  -s, --file_sep TEXT             File separator (csv).\n  -row, --nb_rows INTEGER         Number of rows to import from input_file.\n  -keep, --columns_to_keep FILE   Path to file with columns to keep.\n  -delete, --columns_to_delete FILE\n                                  Path to file with columns to delete.\n  -values, --values_to_keep FILE  Path to file with columns and data to keep.\n  --help                          Show this message and exit.\n```\n\n### Specification for json parameter files\n\nFor the -keep and the `-delete` option, the template is given below :\n\n```json\n[\n\"\u003ccolumn#1\u003e\",\n\"\u003ccolumn#2\u003e\",\n\"\u003ccolumn#3\u003e\",\n\"\u003ccolumn#4\u003e\",\n\"\u003ccolumn#5\u003e\"\n]\n```\n\n**column#x** are the columns you want to select/delete.\n**Note that you can add as many columns as needed.**\n\nFor the `values` option, the template is given below :\n\n```json\n{  \n  \"\u003ccolumn#1\u003e\":[\"\u003cvalue#1\u003e\", \"\u003cvalue#2\"],    \n  \"\u003ccolumn#2\u003e\":[\"\u003cvalue#1\u003e\", \"\u003cvalue#2\", \"\u003cvalue#3\", \"\u003cvalue#4\"],  \n  \"\u003ccolumn#3\u003e\":[\"\u003cvalue#1\u003e\"]   \n}\n```\n\n**column#x** are the columns you want to select/delete.\n**value** is a list of the values you want to keep on this column.\n**Note that you can add as many columns as needed.**\n\n### Build \u0026 run docker image (locally)\n\nBuild a local docker image using the following command line:\n\n```sh\ndocker build -t data-selector .\n```\n\nOnce built, you can run the container locally with the following command line:\n\n```sh\ndocker run -ti --rm -v \u003cyour_path\u003e:/DATA data-selector selector -i DATA/\u003cpath_to_data\u003e -out DATA/\u003cout_name\u003e -s \u003cfile_sep\u003e -keep DATA/\u003cpath_to_select_columns\u003e -delete DATA/\u003cpath_to_delete_columns\u003e -values DATA/\u003cpath_to_select_data_columns\u003e\n```\n\n-v allows to mount a volume and to use your local data on the docker environment.\n\n**your_path**: Local directory where the data (data to be selected, and parameter json files) are stored\n\n**path_to_data**: The name of the file to select data from (in the Directory).\n\n**out_name**: The name you want to give to the output file.\n\n**file_sep**: File separator of the input file.\n\n**path_to_select_columns**: Path towards json parametrization file.\n\n**path_to_delete_columns**: Path towards json parametrization file.\n\n**path_to_select_data_columns**: Path towards json parametrization file.\n\n## Build\n\nProject is built by [poetry](https://python-poetry.org).\n\n```sh\npoetry install\n```\n\n## Lint\n\n### Python linting\n\n\u003e ⚠️ Be sure to write code compliant with linters or else you'll be rejected by the CI.\n**Code linting** is performed by [flake8](https://flake8.pycqa.org).\n\n```sh\npoetry run flake8 --count --show-source --statistics\n```\n\n**Static type check** is performed by [mypy](http://mypy-lang.org/).\n\n```sh\npoetry run mypy .\n```\n\n## Unit Test\n\n\u003e ⚠️ Be sure to write tests that succeed or else you'll be rejected by the CI.\nUnit tests are performed by the [pytest](https://docs.pytest.org) testing framework.\n\n```sh\npoetry run pytest -v\n```\n\n## You want to get involved? 😍\n\nPlease check out OKP4 health files :\n\n- [Contributing](https://github.com/okp4/.github/blob/main/CONTRIBUTING.md)\n- [Code of conduct](https://github.com/okp4/.github/blob/main/CODE_OF_CONDUCT.md)\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokp4%2Fdata-selector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokp4%2Fdata-selector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokp4%2Fdata-selector/lists"}