{"id":34085706,"url":"https://github.com/agude/switrs-to-sqlite","last_synced_at":"2026-01-18T11:54:48.541Z","repository":{"id":47628328,"uuid":"68351564","full_name":"agude/SWITRS-to-SQLite","owner":"agude","description":"Python script for converting California's Statewide Integrated Traffic Records System (SWITRS) reports to SQLite.","archived":false,"fork":false,"pushed_at":"2025-02-02T23:42:21.000Z","size":385,"stargazers_count":12,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-11-28T01:46:07.579Z","etag":null,"topics":["conversion","database","python","sqlite","switrs"],"latest_commit_sha":null,"homepage":"https://alexgude.com/blog/switrs-to-sqlite/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/agude.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-09-16T04:06:12.000Z","updated_at":"2025-07-07T16:52:18.000Z","dependencies_parsed_at":"2023-10-20T16:25:18.288Z","dependency_job_id":null,"html_url":"https://github.com/agude/SWITRS-to-SQLite","commit_stats":{"total_commits":156,"total_committers":1,"mean_commits":156.0,"dds":0.0,"last_synced_commit":"5d429026230a05fbfb0e601ef6401e7b851ebad6"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/agude/SWITRS-to-SQLite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agude%2FSWITRS-to-SQLite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agude%2FSWITRS-to-SQLite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agude%2FSWITRS-to-SQLite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agude%2FSWITRS-to-SQLite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agude","download_url":"https://codeload.github.com/agude/SWITRS-to-SQLite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agude%2FSWITRS-to-SQLite/sbom","scorecard":{"id":171331,"data":{"date":"2025-08-11","repo":{"name":"github.com/agude/SWITRS-to-SQLite","commit":"568e12dd3ea0c934d04cde1c544e97b4e1330592"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 2/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/agude/SWITRS-to-SQLite/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/agude/SWITRS-to-SQLite/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/agude/SWITRS-to-SQLite/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/agude/SWITRS-to-SQLite/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:87: update your workflow using https://app.stepsecurity.io/secureworkflow/agude/SWITRS-to-SQLite/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/agude/SWITRS-to-SQLite/tests.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/agude/SWITRS-to-SQLite/tests.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:64","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:73","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:34","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:40","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:44","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:38","Warn: pipCommand not pinned by hash: .github/workflows/tests.yml:42","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   8 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:46"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 5 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T16:33:40.281Z","repository_id":47628328,"created_at":"2025-08-16T16:33:40.281Z","updated_at":"2025-08-16T16:33:40.281Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27728911,"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","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["conversion","database","python","sqlite","switrs"],"created_at":"2025-12-14T13:11:19.622Z","updated_at":"2026-01-18T11:54:48.525Z","avatar_url":"https://github.com/agude.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SWITRS-to-SQLite\n\n**Looking to get right to work with the data? Checkout the cleaned dataset on\nKaggle: [California Traffic Collision Data from SWITRS][kaggle]**\n\n[kaggle]: https://www.kaggle.com/alexgude/california-traffic-collision-data-from-switrs\n\nSWITRS-to-SQLite is a Python3 script that will convert the CSV files\nprovided by the California Highway Patrol's [Statewide Integrated Traffic\nRecords System (SWITRS)](http://iswitrs.chp.ca.gov/Reports/jsp/userLogin.jsp)\nand convert them to an [SQLite3](https://www.sqlite.org/) database.\n\nInstructions to **download the SWITRS data** can be found\n[here](requesting_data.md).\n\n## Versioning\n\nThis repository follows [Semver][semver]. I will increment the **MAJOR**\nversion if a change is backwards incompatible for either the Python\ncommand line or the structure of the output database.\n\n[semver]: https://semver.org/\n\n## Installation\n\nThe best way to install SWITRS-to-SQLite is with `pip`:\n\n```bash\npip install switrs-to-sqlite\n```\n\nOr with [UV](https://docs.astral.sh/uv/):\n\n```bash\nuv pip install switrs-to-sqlite\n```\n\nThis will give you access to the script simply by calling:\n\n```bash\nswitrs_to_sqlite --help\n```\n\n### Development Installation\n\nFor development, clone the repository and use UV:\n\n```bash\ngit clone https://github.com/agude/SWITRS-to-SQLite.git\ncd SWITRS-to-SQLite\nuv sync --dev\n```\n\nSWITRS-to-SQLite requires Python 3.10+.\n\n## Usage\n\nUsing SWITRS-to-SQLite is simple, just point it to the unzipped files from\nSWITRS and it will run the conversion:\n\n```bash\nswitrs_to_sqlite \\\nCollisionRecords.txt \\\nPartyRecords.txt \\\nVictimRecords.txt\n```\n\nThe script also supports reading `gzip`ed records files:\n\n```bash\nswitrs_to_sqlite \\\nCollisionRecords.txt.gz \\\nPartyRecords.txt.gz \\\nVictimRecords.txt.gz\n```\n\nThe conversion process will take about an hour to write the database, which by\ndefault is saved to a file named `switrs.sqlite3`. The output file can be\nchanged as follows:\n\n```bash\nswitrs_to_sqlite \\\nCollisionRecords.txt \\\nPartyRecords.txt \\\nVictimRecords.txt \\\n-o new_db_file.sql\n```\n\nThe program provides the following help menu when called with `--help`:\n\n```bash\nusage: switrs_to_sqlite [-h] [-o OUTPUT_FILE]\n                             collision_record party_record victim_record\n\nConvert SWITRS text files to a SQLite database\n\npositional arguments:\n  collision_record      the CollisionRecords.txt file or the same file gzipped\n  party_record          the PartyRecords.txt file or the same file gzipped\n  victim_record         the VictimRecords.txt file or the same file gzipped\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -o OUTPUT_FILE, --output-file OUTPUT_FILE\n                        file to save the database to\n```\n\n## Unit Tests\n\nSWITRS-to-SQLite uses `pytest` to run unit tests (contained in the `tests`\nfolder). To run the tests:\n\n```bash\nuv run pytest -vv\n```\n\nOr with [just](https://github.com/casey/just):\n\n```bash\njust test\n```\n\nRun `just` with no arguments to see all available commands.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagude%2Fswitrs-to-sqlite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagude%2Fswitrs-to-sqlite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagude%2Fswitrs-to-sqlite/lists"}