{"id":16875673,"url":"https://github.com/kilo59/csv2http","last_synced_at":"2025-04-10T17:33:48.461Z","repository":{"id":38007186,"uuid":"499931757","full_name":"Kilo59/csv2http","owner":"Kilo59","description":"http request per rows in a csv","archived":false,"fork":false,"pushed_at":"2024-12-02T05:20:37.000Z","size":240,"stargazers_count":1,"open_issues_count":7,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-18T00:39:12.038Z","etag":null,"topics":["csv","http","http-client","json"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/csv2http/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kilo59.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-06-04T20:38:23.000Z","updated_at":"2024-11-12T15:46:04.000Z","dependencies_parsed_at":"2023-02-18T20:16:10.718Z","dependency_job_id":"4d73a6b7-8ad9-408c-82dd-79faa899fab5","html_url":"https://github.com/Kilo59/csv2http","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kilo59%2Fcsv2http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kilo59%2Fcsv2http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kilo59%2Fcsv2http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kilo59%2Fcsv2http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kilo59","download_url":"https://codeload.github.com/Kilo59/csv2http/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230743283,"owners_count":18273830,"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":["csv","http","http-client","json"],"created_at":"2024-10-13T15:36:45.174Z","updated_at":"2024-12-21T16:38:18.128Z","avatar_url":"https://github.com/Kilo59.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# csv2http\n\n[![ci](https://github.com/Kilo59/csv2http/workflows/ci/badge.svg)](https://github.com/Kilo59/csv2http/actions)\n[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Kilo59/csv2http/main.svg)](https://results.pre-commit.ci/latest/github/Kilo59/csv2http/main)\n[![pypi version](https://img.shields.io/pypi/v/csv2http.svg)](https://pypi.org/project/csv2http/)\n![Python Versions](https://img.shields.io/pypi/pyversions/csv2http)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=Kilo59_csv2http\u0026metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=Kilo59_csv2http)\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Kilo59_csv2http\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=Kilo59_csv2http)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nCLI tool and library for making a series of JSON or form-encoded HTTP requests based on a CSV file input.\n\n![Demo](images/demo1.svg)\n\n## Quick start\n\nInstall\n\n```\npip install csv2http\n```\n\nOr with [pipx](https://pypa.github.io/pipx/) (recommended)\n\n```\npipx install csv2http\n```\n\nCheck CLI usage\n\n```\n❯ csv2http --help\nusage: csv2http [-h] [-c CONCURRENCY] [--method {POST,PATCH,PUT}] [-a AUTH] [-H [HEADER ...]] [-d] [-n] [-t TIMEOUT] file url\n\nHTTP request for every row of a CSV file - v0.0.3a1\n\npositional arguments:\n  file                  payload csv file\n  url                   URL destination - called with `http` if scheme is absent\n\noptions:\n  -h, --help            show this help message and exit\n  -c CONCURRENCY, --concurrency CONCURRENCY\n                        Maximum number of concurrent requests (default: 25)\n  --method {POST,PATCH,PUT}\n                        HTTP method/verb (default: POST)\n  -a AUTH, --auth AUTH  Basic Authentication enter \u003cUSERNAME\u003e:\u003cPASSWORD\u003e. If password is blank you will be prompted for input\n  -H [HEADER ...], --header [HEADER ...]\n                        Header `key:value` pairs\n  -d, --form-data       Send payload as form encoded data instead of JSON (default: false)\n  -n, --no-save         Do not save results to log file (default: false)\n  -t TIMEOUT, --timeout TIMEOUT\n                        Connection timeout of the request in seconds (default: 5)\n```\n\n### Mockbin Example\n\nMake POST calls to http://mockbin.org from a local csv file.\n\n---\n\nFirst setup a new `bin`, using [httpie](https://httpie.io/cli), curl or the [web ui](http://mockbin.io) and get a bin id.\n\n```\n❯ http POST mockbin.io/bin/create status:=201 statusText=Created httpVersion=HTTP/1.1 headers:='[]' cookies:='[]' 'content[mimeType]'=application/json --body\n\"9e95289e-d048-4515-9a61-07f2c74810f5\"\n```\n\nCreate your `my_file.csv` and pass it to `csv2http`.\nUse the returned bin id from before.\n\n```\n❯ csv2http my_file.csv mockbin.io/bin/9e95289e-d048-4515-9a61-07f2c74810f5 --concurrency 3\n POST http://mockbin.io/bin/9e95289e-d048-4515-9a61-07f2c74810f5\n  status codes - {200: 3}\n  status codes - {200: 3}\n  status codes - {200: 3}\n  status codes - {200: 1}\n```\n\nCheck the bin log from.\nhttps://mockbin.org/bin/9e95289e-d048-4515-9a61-07f2c74810f5/log\n\n### Set Auth and Headers\n\nHeader key, value pairs can be set with the `-H` or `-header` flag.\n\nKey value pairs should be separated with either a `:` or `=`.\n\n```\ncsv2http my_file.csv httpbin.org/post -H user-agent:csv2http-cli x-custom-header=foobar\n```\n\nTo provide basic auth pass a username and password with `-a` or `--auth`.\n\nIf the password is omitted you will be prompted to provide it.\n\n```\n--auth my_username:my_password\n```\n\n```\n--auth my_username\n```\n\n## Roadmap\n\n- [x] As Library - Alpha\n  - [x] parse csv as dictionary/json - Alpha\n  - [x] accept mutator function - Alpha\n  - [x] HTTP POST request with json from csv - Alpha\n  - [x] limit concurrency - Alpha\n  - [ ] non-blocking file IO - ???\n  - [ ] hooks for response results - Beta\n  - [ ] mkdoc docs - Beta\n- [ ] As CLI - Beta\n  - [x] argparse - Alpha\n  - [x] write results to logfile - Beta\n  - [ ] progress bar - ???\n  - [ ] use dedicated CLI library with pretty colors (typer, rich etc.) - Beta\n  - [ ] Nested fields - V1\n- [ ] Complete Docs - V1\n  - [ ] `create_mockbin.csv` and `example.csv` to use in quickstart - Beta\n  - [ ] examples for using as library\n- [x] GH Actions CI (lint, test, etc.)\n- [ ] GH Actions CD (publish to pypi)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkilo59%2Fcsv2http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkilo59%2Fcsv2http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkilo59%2Fcsv2http/lists"}