Metadata-Version: 2.4
Name: sancho-fetch
Version: 0.1.0rc1
Summary: Ask your AI for public data. Get real files on your computer.
Author: Pantheon Network
License: 
                                         Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link (or bind by name) to the interfaces of,
              the Work and Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent claims licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or as an addendum to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or consequential damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the file format. We also recommend that a
              file or class name and description of purpose be included on the
              same "printed page" as the copyright notice for easier
              identification within third-party archives.
        
           Copyright 2026 Pantheon Network
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
Project-URL: Homepage, https://pantheonnetwork.co
Project-URL: Repository, https://github.com/panth-net/sancho-fetch
Project-URL: Issues, https://github.com/panth-net/sancho-fetch/issues
Keywords: data,open-data,fetch,ai-agent,mcp,census,public-data
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: End Users/Desktop
Classifier: Topic :: Scientific/Engineering :: Information Analysis
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: LICENSE-DOCS.md
License-File: NOTICE
Requires-Dist: PyYAML>=6.0.1
Requires-Dist: requests>=2.32.0
Requires-Dist: packaging>=24.0
Requires-Dist: openpyxl>=3.1.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Provides-Extra: analysis
Requires-Dist: polars>=1.0.0; extra == "analysis"
Requires-Dist: duckdb>=1.0.0; extra == "analysis"
Requires-Dist: pyarrow>=16.0.0; extra == "analysis"
Provides-Extra: all
Requires-Dist: polars>=1.0.0; extra == "all"
Requires-Dist: duckdb>=1.0.0; extra == "all"
Requires-Dist: pyarrow>=16.0.0; extra == "all"
Dynamic: license-file

![Sancho Fetch](https://raw.githubusercontent.com/panth-net/sancho-fetch/master/project-docs/assets/banner.jpg)

# Sancho Fetch

Ask your AI for public data. Get real files on your computer.

## The fastest way in: tell your AI

Open your AI's code mode -- **Claude** desktop app -> **Code** tab, or
**ChatGPT** desktop app -> **Codex** -- pick any folder, and paste this:

> Install Sancho Fetch from PyPI (`uv tool install sancho-fetch`) and set it
> up on this computer. If `uv` isn't installed, tell me, then install it
> first. When you're done, tell me whether the install succeeded. Then
> explain in plain English, no jargon: what the .env file is, how to use it,
> where it is on my computer, and open it for me so I can paste API keys
> straight into it. Give me a few examples of data sources that need a free
> API key and a few examples of sources that don't need a key. Tell me where
> my downloaded data gets saved, and how I update Sancho later. Then run a
> short example data fetch using the World Bank so I can see where the data
> was saved. Finally tell me a few natural language examples I can tell you
> to fetch data so I can get a feel for how to use sancho-fetch and remind
> me that 1) I can use it anywhere as long as I'm in a LLM Desktop app's
> Code tab (e.g. ChatGPT Desktop or Claude Desktop), and 2) that I can ask
> AI to add new data sources by itself since sancho-fetch is built in a way
> that it's easily extensible (aka you can add more to it and the AI will do
> the heavy lifting and connect the new data source). As the team behind
> Sancho Fetch, we hope you truly make it yours as an internal resource to
> power your work.

That's the whole install.

**Install once, use everywhere.** Install Sancho once on your computer, and it works across ChatGPT Desktop, Claude Desktop, etc. 

To use Sancho, just ask for data and mention "sancho" in plain English, or type **`/sancho`** to feel cool.

## What it does

- You ask: *"get county-level asthma rates for Ohio."* within Claude Desktop Code or ChatGPT Desktop's Code modes (you can be working in any folder or not working in a folder at all).
- Your AI uses Sancho to pull from 120+ public sources (Census, World Bank,
  FDA, USGS, FEMA, ...) and hands you a file that opens in Excel.
- Everything is saved on your computer.

## Before you begin

Sancho requires **Python 3.11 or newer** and an internet connection during
first-time setup. Install Python from
[python.org](https://www.python.org/downloads/) first, or let the installer's
`uv` package manager download a compatible isolated Python for Sancho. It does
not replace your computer's system Python.

**Node.js is optional.** You only need Node 18 or newer for the optional npm
wrapper. API keys are not required for installation or the built-in World Bank
setup check; provider-specific keys can be added later.

## Get started (about 2 minutes)

Install straight from PyPI.

**1. Open your AI's code mode.**

- **Claude:** Claude desktop app -> **Code** tab -> new session -> pick any folder where you want your data to live.
- **ChatGPT:** ChatGPT desktop app -> **Codex** -> open that folder.

**2. Paste the install request from the top of this page.**

The AI installs everything, shows you your first data file, and walks you
through where everything lives.

**3. Fully quit and restart the Claude or ChatGPT desktop app after the installation is complete.**

NOTE: Before using, make sure to add API keys for any sources you want to use. 

Many sources need no key (World Bank, USGS, FEMA, openFDA, ...). Your AI will tell you when an API key is needed.
You can either:

1. Open the `.env` file in the `sancho-workspace` folder and paste your key there; or
2. Ask your AI to open the keys file for you (`sancho env open`). Paste the key into the opened file, **don't paste your key 
into the chat**. 

Setup normally creates `.env` from `.env.example`. If `.env` is missing,
`sancho env open` creates and opens it. To do this manually, copy
`.env.example` in the same folder, keep the original template, and name the
copy `.env`.

Both files may be hidden:

- **macOS Finder:** press `Cmd+Shift+.` (Command + Shift + period).
- **Windows File Explorer:** select **View -> Show -> Hidden items**.

@Developers, fyi Sancho is designed to read key names only, not values.

<details>
<summary><strong>Prefer the GitHub repository, or installing without an AI app?</strong></summary>

For contributing, custom module development, or offline installs, work from
the repository folder instead. Install
[GitHub Desktop](https://desktop.github.com/) (free), then on this
repository's page click **Code** -> **Open with GitHub Desktop** ->
**Clone**.

Note: Avoid placing the Github folder in a folder that is within iCloud/OneDrive (e.g. Documents folder in iCloud). This causes issues with file syncing and speed.

Then double-click `installers/Install Sancho.command` (macOS) or
`installers/Install Sancho.bat` (Windows); on Linux run
`bash installers/setup.sh`.

- macOS blocks the first open (the installer is not notarized): **System
  Settings -> Privacy & Security** -> scroll to the blocked-file message ->
  **Open Anyway** -> open it again.
- Windows: at "Windows protected your PC", click **More info** ->
  **Run anyway**.

</details>

## Everyday use

- In Claude Code / Codex, just ask for data, or use
  **`/sancho`** and **`/sancho-update`** directly.

> **After installation, use a Code session.** Sancho is installed
> computer-wide, so you do not need to add the `sancho-fetch` folder in future
> sessions. In **Claude Desktop, select the Code tab**. In **Codex, start a
> Code chat**. Regular chats cannot access your local Sancho installation.


- There are system instructions to make Sancho return non-technical details of each data pull, so if you want these technical details returned, tell your AI:

>  *"turn on Sancho developer mode."*

- Something off? Ask your AI to run `sancho ready` -- it checks and repairs
  the setup.

## Where your files land

```text
your folder/
  sancho-downloads/    # <-- files you have downloaded via chatting with AI
  sancho-workspace/
    source/            # managed data modules
    custom/            # your own modules -- never overwritten when updating Sancho
    playbooks/         # your repeatable workflows
    fetched-data/      # faithful archive of every fetch (don't edit - this is a cache so we don't have to use API calls unnecessarily)
    analysis-data/     # your derived work
    outputs/           # reports, dashboards, exports
    logs/              # what Sancho did, when, and why
    update-backups/    # snapshots before every update
    .env               # your API keys (never logged, never printed)
```

Every fetch writes a **working file you open** -- into `sancho-downloads/` in the folder that you're working in -- and a **faithful archive/cache copy** in `sancho-workspace/fetched-data/` so repeat requests reuse cached data. 

Tables arrive as Excel `.xlsx` with codes like
`01003` kept intact; maps stay GeoJSON/KML; nothing is converted in a way
that loses information. Filenames start with the date:
`2026-06-08_194211_alabama-population.xlsx`.


## Add your own data sources

Tell your AI:

> Create a Sancho module for [that API / that agency's data / this file I
> receive every month].

It's built under `custom/`, works like the built-in sources, and Sancho updates never overwrite the folder.

A good example of this is, Sancho fetches from Washington DC's and New York City's open data portals, which use a common API/open data portal format. The AI can be asked to create a module for other cities and will intelligently check on its own whether the new city uses the same format or not, and if it does, will reuse the same module code format (and otherwise, create a new one). **You'd be surprised at how many cities use the same format so give it a try if you're working in a geographic regional level that is not already covered by Sancho's built-in modules.**

## Updates

Just ask your AI:

> Update Sancho.

The AI upgrades the `sancho` command from PyPI (`uv tool upgrade sancho-fetch`)
and then migrates your workspace safely, with a backup and a rollback command.

Working from the GitHub repository instead? In GitHub Desktop: **Fetch
origin -> Pull origin**, then tell your AI *"update Sancho."*

When updating, your own files (`custom/`, `playbooks/`, `fetched-data/`, `.env`,
...) are never touched. 

If you want Sancho to stop mentioning new versions in chats (which it will do once every 2 weeks), simply set `SANCHO_UPDATE_NUDGE=false` in `.env` to turn it off.


## Uninstalling

Same as installing: paste one request to your AI in a Code session.

> Uninstall Sancho Fetch from this computer: run `uv tool uninstall
> sancho-fetch`, delete the `~/.sancho` folder, delete the `sancho` and
> `sancho-update` folders from `~/.claude/skills/` and `~/.agents/skills/` if
> they exist, and remove the `"sancho"` entry from Claude Desktop's MCP config
> file if it has one. Keep my `sancho-workspace` folder and everything in it --
> that is my data and my API keys. Tell me when it's done and what was removed.

Your `sancho-workspace/` folder (fetched data, custom modules, `.env` keys) and
your `sancho-downloads/` files are **always kept**. Delete them yourself if you
also want the data gone.

Working from the GitHub repository instead? Double-click
`installers/Uninstall Sancho.command` (macOS) or
`installers/Uninstall Sancho.bat` (Windows); on Linux run
`bash installers/uninstall.sh`. Add `--purge` only if you also want
`sancho-workspace/` (your data and keys) deleted.

## More documentation

- [`CHANGELOG.md`](CHANGELOG.md) -- what changed in each release.
- [`README_ALL_INSTRUCTIONS.md`](README_ALL_INSTRUCTIONS.md) -- full
  operator/AI reference.
- [`project-docs/MCP_SERVER_SETUP_CLAUDE_CHATGPT_WEB.md`](project-docs/MCP_SERVER_SETUP_CLAUDE_CHATGPT_WEB.md) --
  MCP setup details for desktop and web clients.
- [`project-docs/MODULE_CREATION_GUIDE.md`](project-docs/MODULE_CREATION_GUIDE.md) --
  how your AI builds new data modules.

## Hosting your own version of Sancho

While Sancho is designed to run on your own computer, you can also host it on a server so that users can access it via web rather than needing Claude/Codex desktop apps. 

The idea with hosting was primarily to support organizations hosting hands-on workshops for users who may not have the technical skills to install Sancho on their own computers.

- [`hosting/README.md`](hosting/README.md) -- hosted demo endpoint for events.

## For AI assistants

If you are an AI assistant, do not operate from this quick start. Read
[`README_ALL_INSTRUCTIONS.md`](README_ALL_INSTRUCTIONS.md), then follow
[`CLAUDE.md`](CLAUDE.md) or [`AGENTS.md`](AGENTS.md).

## License

Code is licensed under Apache 2.0; documentation under CC BY 4.0 unless
noted. The Sancho name, logo, and brand assets are protected separately --
see [LICENSE](./LICENSE), [NOTICE](./NOTICE),
[LICENSE-DOCS.md](./LICENSE-DOCS.md), and [INTENDED_USE.md](./INTENDED_USE.md).
