{"id":29958297,"url":"https://github.com/willwade/anytext-to-cite","last_synced_at":"2025-08-03T20:11:11.207Z","repository":{"id":291823391,"uuid":"978856791","full_name":"willwade/anytext-to-cite","owner":"willwade","description":"Converts chunks of text to correct citation formats for your needs","archived":false,"fork":false,"pushed_at":"2025-05-06T17:29:46.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T18:38:24.795Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willwade.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,"zenodo":null}},"created_at":"2025-05-06T16:01:25.000Z","updated_at":"2025-05-06T17:29:49.000Z","dependencies_parsed_at":"2025-05-06T18:41:32.490Z","dependency_job_id":"bd3c8cc5-2ec9-44ba-89f2-debb7338aeff","html_url":"https://github.com/willwade/anytext-to-cite","commit_stats":null,"previous_names":["willwade/anytext-to-cite"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/willwade/anytext-to-cite","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fanytext-to-cite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fanytext-to-cite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fanytext-to-cite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fanytext-to-cite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willwade","download_url":"https://codeload.github.com/willwade/anytext-to-cite/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willwade%2Fanytext-to-cite/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268604282,"owners_count":24276998,"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-08-03T02:00:12.545Z","response_time":2577,"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":[],"created_at":"2025-08-03T20:10:38.646Z","updated_at":"2025-08-03T20:11:11.196Z","avatar_url":"https://github.com/willwade.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Anytext-to-Citation\n\nA web API and frontend tool that converts unstructured citation text into structured Hayagriva YAML format and other citation formats (BibTeX, CSL-JSON, RIS) using Large Language Models.\n\n## Overview\n\nAnytext-to-Citation leverages the power of Large Language Models (LLMs) to parse and structure citation data from plain text. Unlike traditional citation parsers that rely on rigid patterns and rules, this tool can handle a wide variety of citation styles and formats by using AI to understand the semantic structure of citations.\n\n### Key Features\n\n- **Flexible Input**: Process citations in virtually any format or style\n- **Multiple Output Formats**: Convert to Hayagriva YAML, BibTeX, CSL-JSON, and RIS\n- **Web Interface**: User-friendly interface for pasting or uploading citation text\n- **API Access**: RESTful API endpoints for integration with other tools\n- **Real-time Progress Tracking**: Monitor the conversion process with detailed progress updates\n\n## Similar Tools\n\nThis project was inspired by and complements other citation parsing tools:\n\n- [AnyStyle.io](https://anystyle.io): A machine learning-based citation parser that extracts structured references from plain text\n- [Text2Bib.org](https://text2bib.org): A tool that converts plain text citations to BibTeX format\n\nUnlike these tools, Anytext-to-Citation uses state-of-the-art LLMs to handle more complex and varied citation formats, and offers multiple output formats including Hayagriva YAML.\n\n## Setup\n\n### Prerequisites\n\n- Python 3.8+\n- [Simon Willison's LLM tool](https://github.com/simonw/llm)\n- API keys for OpenAI (preferred) or Google Gemini\n\n### Installation\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/yourusername/anytext-to-citation.git\n   cd anytext-to-citation\n   ```\n\n2. Install dependencies:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n3. Set up environment variables:\n   ```bash\n   cp .envrc.example .envrc\n   # Edit .envrc with your API keys\n   ```\n\n   If you use `direnv`, run:\n   ```bash\n   direnv allow\n   ```\n   Otherwise, load the environment variables manually.\n\n### Running the Application\n\n```bash\nuvicorn convert:app --reload\n```\n\nThe application will be available at http://localhost:8000\n\n## API Endpoints\n\n### Convert to Hayagriva YAML\n\n```\nPOST /api/convert-to-hayagriva\n```\n\nRequest body:\n```json\n{\n  \"text\": \"Your citation text here\"\n}\n```\n\nResponse:\n```json\n{\n  \"yaml\": \"# Hayagriva YAML content\"\n}\n```\n\n### Convert Format\n\n```\nPOST /api/convert-format\n```\n\nRequest body:\n```json\n{\n  \"yaml_content\": \"Your Hayagriva YAML here\",\n  \"output_format\": \"bibtex|csl-json|ris\"\n}\n```\n\nResponse:\n```json\n{\n  \"format\": \"bibtex|csl-json|ris\",\n  \"converted_content\": \"Converted content\"\n}\n```\n\n### Check Progress\n\n```\nGET /api/progress\n```\n\nResponse:\n```json\n{\n  \"status\": \"idle|splitting|processing|complete|error\",\n  \"message\": \"Status message\",\n  \"current\": 0,\n  \"total\": 0\n}\n```\n\n## How It Works\n\n1. The application splits the input text into individual citation entries\n2. Each citation is processed by an LLM (OpenAI GPT-4o, GPT-4, GPT-3.5-turbo, or Gemini)\n3. The LLM converts the unstructured text into structured Hayagriva YAML format\n4. The Hayagriva YAML can then be converted to other formats (BibTeX, CSL-JSON, RIS)\n\n## License\n\nMIT\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillwade%2Fanytext-to-cite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillwade%2Fanytext-to-cite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillwade%2Fanytext-to-cite/lists"}