{"id":16884534,"url":"https://github.com/timwis/slugify-headers","last_synced_at":"2026-05-17T12:04:38.901Z","repository":{"id":140607022,"uuid":"45795132","full_name":"timwis/slugify-headers","owner":"timwis","description":"A python script to get database_friendly_field_names for a CSV file","archived":false,"fork":false,"pushed_at":"2015-11-08T20:09:50.000Z","size":0,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-25T07:11:24.408Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timwis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-08T19:24:27.000Z","updated_at":"2019-05-31T00:25:40.000Z","dependencies_parsed_at":"2023-03-13T16:56:56.752Z","dependency_job_id":null,"html_url":"https://github.com/timwis/slugify-headers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fslugify-headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fslugify-headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fslugify-headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timwis%2Fslugify-headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timwis","download_url":"https://codeload.github.com/timwis/slugify-headers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244557617,"owners_count":20471861,"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-10-13T16:29:05.801Z","updated_at":"2026-05-17T12:04:38.811Z","avatar_url":"https://github.com/timwis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slugify Headers\nA python script to get database_friendly_field_names for a CSV file\n\n## Usage\nGiven a CSV file where the first row contains malformed headers, ie.:\n```\nAnimal,No. of Legs, DOMESTICATED, Notes** Here\nDog, 4, true, \"great pet\"\nCat, 4, false, \"no thx\"\n```\n\nPass the file to this script via `stdin` and it will return database-friendly headers \nwith special characters and extra spaces removed:\n```bash\n$ cat data.csv | python main.py\n\u003e animal,no_of_legs,domesticated,notes_here\n```\n\nFor greater efficiency, just pass the first row of the CSV file:\n```bash\n$ head -1 data.csv | python main.py\n\u003e animal,no_of_legs,domesticated,notes_here\n```\n\nTo replace the header line in the original file, use silly simple posix programs:\n```bash\n# Get clean headers and put then in a new file\n$ head -1 data.csv | python main.py \u003e new_data.csv\n\n# Append the source file without the first row to the new file\n$ tail -n+2 data.csv \u003e\u003e new_data.csv\n```\n\nTo output the headers as JSON, append the `--json` argument:\n```bash\n$ head -1 data.csv | python main.py --json\n\u003e [\"animal\", \"no_of_legs\", \"domesticated\", \"notes_here\"]\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimwis%2Fslugify-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimwis%2Fslugify-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimwis%2Fslugify-headers/lists"}