{"id":15104872,"url":"https://github.com/aitoroses/natural-lens","last_synced_at":"2025-04-05T12:40:33.411Z","repository":{"id":254152800,"uuid":"845636241","full_name":"aitoroses/natural-lens","owner":"aitoroses","description":"Natural Lens is a command-line tool that enables interactive exploration and analysis of database schemas through AI.","archived":false,"fork":false,"pushed_at":"2024-09-23T09:54:07.000Z","size":860,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-10T23:52:47.075Z","etag":null,"topics":["ai","cli","openai","postgres"],"latest_commit_sha":null,"homepage":"","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/aitoroses.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":"2024-08-21T16:20:37.000Z","updated_at":"2024-09-23T09:54:11.000Z","dependencies_parsed_at":"2024-10-31T04:40:37.389Z","dependency_job_id":"95acc160-f3ad-4b99-83f8-b87ea1018eaa","html_url":"https://github.com/aitoroses/natural-lens","commit_stats":{"total_commits":24,"total_committers":1,"mean_commits":24.0,"dds":0.0,"last_synced_commit":"141a68213ce710ae46f3a7af5c2e59070f66bc3b"},"previous_names":["aitoroses/cognitive-schema","aitoroses/natural-lens"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Fnatural-lens","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Fnatural-lens/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Fnatural-lens/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aitoroses%2Fnatural-lens/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aitoroses","download_url":"https://codeload.github.com/aitoroses/natural-lens/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339132,"owners_count":20923009,"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":["ai","cli","openai","postgres"],"created_at":"2024-09-25T20:03:19.375Z","updated_at":"2025-04-05T12:40:33.392Z","avatar_url":"https://github.com/aitoroses.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Natural Lens\n\nUnlock the power of your database schema with **Natural Lens**! This innovative command-line interface (CLI) tool allows you to interactively explore your database schemas, generating insightful profiles and facilitating intelligent queries. Say goodbye to tedious data analysis and hello to a seamless dialogue with your database!\n\n\u003cimg src=\"./logo.png\" alt=\"Natural Lens Logo\" width=\"200\" height=\"200\"\u003e\n\n## Features\n\n- **Effortlessly Download Schemas**: Quickly connect to your database and fetch the schema with a single command.\n- **Instant Sample Data**: Automatically retrieve and save sample data for each table, ready for in-depth analysis.\n- **AI-Powered Table Profiles**: Generate detailed profiles for each table, revealing their structure, purpose, and significant insights.\n- **Interactive Query Interface**: Engage in a conversational manner with your database schema, asking questions and receiving AI-generated responses based on the profiles.\n- **User-Friendly CLI**: Enjoy a seamless command-line experience designed for both beginners and experts, making database exploration intuitive and efficient.\n- **Future Database Support**: I plan to support additional databases in the future, expanding the capabilities of **Natural Lens**.\n\n## Current Database Support\n\n- **PostgreSQL**\n- **Trino** (currently supports OAuth only)\n\n## Requirements\n\n- Python 3.6 or higher\n- OpenAI API key\n\n## Installation\n\n1. Install the package using pip:\n   ```bash\n   pip install natural-lens\n   ```\n2. Set your OpenAI API key as an environment variable:\n   ```bash\n   export OPENAI_API_KEY='your_openai_api_key'  # On Windows use: set OPENAI_API_KEY='your_openai_api_key'\n   ```\n\n## Usage\n\nThe CLI will be available as `nlens`. Run the following command to see the available options:\n\n```bash\nnlens --help\n```\n\nRefer to the [Northwind Example](./examples/northwind/README.md) to test **Natural Lens** with a sample PostgreSQL or Trino database.\n\n## Troubleshooting\n\n- **Error: Connection failed**: Ensure that your database credentials are correct and that the database server is running.\n- **Error: OpenAI API key not set**: Make sure you have set your OpenAI API key as an environment variable.\n\n## Contributing\n\n❤️ contributions! Whether you have a bug fix, a new feature, or just a suggestion, your input is invaluable. Join our community and help us make **Natural Lens** even better!\n\n1. Fork the repository.\n2. Create a new branch.\n3. Make your changes and submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. The MIT License allows for reuse within proprietary software, as long as the license is distributed with that software.\n\n## Acknowledgments\n\n- [OpenAI](https://openai.com/) for providing the AI capabilities.\n\n## Get Started Today!\n\nReady to unlock the potential of your database? Clone the repository, set up your environment, and start exploring the world of intelligent data analysis with **Natural Lens**!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitoroses%2Fnatural-lens","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faitoroses%2Fnatural-lens","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faitoroses%2Fnatural-lens/lists"}