A CLI tool to automate research by fetching data from multiple sources and exporting to PDF/CSV.
Project description
SourceFolio
SourceFolio is a CLI tool that automates research by fetching information from multiple sources like Wikipedia, OpenLibrary, and NewsAPI based on user-provided keywords. It provides a seamless experience for collecting and exporting data into clean, readable formats.
Features
- Interactive Session: A guided, step-by-step process for users who prefer a prompted workflow.
- Multiple Data Sources: Gathers data from:
- Wikipedia: Summary or full-page content.
- OpenLibrary: Related books and authors.
- NewsAPI: Recent news articles.
- Smart API Key Handling: Automatically prompts for and securely stores your NewsAPI key on the first run.
- Data Preview: Displays a summary of collected data directly in the terminal before export.
- Multiple Export Formats: Exports comprehensive reports to PDF (with clickable links) and CSV.
- Rich Terminal UI: Uses modern, interactive prompts and progress bars for a better user experience.
๐ฆ Installation
SourceFolio is available on the Python Package Index (PyPI). You can install it directly using pip:
pip install sourcefolio
To upgrade to the latest version, run:
pip install --upgrade sourcefolio
๐ ๏ธ Configuration
SourceFolio requires a free API key from newsapi.org to fetch news articles.
The first time you run the application, it will automatically guide you through a one-time setup:
- You will be prompted to enter your NewsAPI key.
- The application will validate the key to ensure it's working.
- Your key will be securely saved in a configuration file in your home directory (
~/.sourcefolio/config.json) for all future sessions.
On subsequent runs, the application will confirm your saved key and give you the option to continue using it, change it, or remove it.
Usage
Once installed, you can run the tool directly from your terminal.
To start the guided, interactive session, simply run:
sourcefolio
Follow the on-screen prompts to enter keywords, choose the level of detail, and export your research report.
Tip: You can exit the application at any point by pressing Ctrl+C.
โ๏ธ Troubleshooting
ISSUE: Windows: python, py, pip, or sourcefolio is not recognized...
This is a very common issue on Windows, and all these errors point to the same single problem: your Python installation is not added to your system's PATH.
The fix is to manually find your Python installation and Scripts folders and add them to your Windows Environment Variables. This guide will fix all of those errors at once.
Solution (The Manual Fix)
Step 1. Find Your Python Paths
Since the python command doesn't work, we must find the path manually.
- Press the Windows Key to open the Start Menu.
- Type
python. - Right-click on the "Python" app (e.g., "Python 3.11") in the search results and select "Open file location".
- This may open a folder with a shortcut. If it is a shortcut, right-click the shortcut and select "Open file location" again.
- You should now be in the main Python installation folder (you'll see
python.exe). Click in the address bar at the top of the File Explorer to copy this path.
You now have the two paths you need:
- Path 1 (Main Folder): The path you just copied (e.g.,
C:\Users\YourUsername\AppData\Local\Programs\Python\Python311) - Path 2 (Scripts Folder): The exact same path, but with
\Scriptsadded to the end (e.g.,C:\Users\YourUsername\AppData\Local\Programs\Python\Python311\Scripts)
Step 2. Add Both Paths to Environment Variables
- Press the Windows Key, type
env, and select "Edit the system environment variables". - In the window that opens, click the "Environment Variables..." button.
- In the top box ("User variables..."), find the variable named
Path. Click on it, then click "Edit...". - Click the "New" button and paste in Path 1 (the main folder).
- Click "New" again and paste in Path 2 (the
Scriptsfolder). - Click "OK" on all three windows to save and close everything.
Step 3. Restart Your Terminal
- This is the most important step. Completely close and re-open your PowerShell or CMD window.
- To confirm it worked, type
pip --version. You should see the version number. - You can now successfully run
pip install sourcefolio.
Still confused? Here is a short YouTube video that walks you through this exact process.
ISSUE: Linux (Ubuntu/Debian): sourcefolio: command not found
This is a common issue on many Linux distributions. When you install a package with pip as a user, it places the command in ~/.local/bin. This folder is often not in your shell's PATH by default.
Solution (The One-Liner Fix)
You only need to run these two commands in your terminal.
Step 1. Add the Path to Your Shell Configuration
This command adds the user-level bin folder to your PATH permanently.
echo 'export PATH="$PATH:$HOME/.local/bin"' >> ~/.bashrc
(Note: If you are using Zsh (like on modern macOS or some custom Linux setups) instead of Bash, you would use ~/.zshrc instead of ~/.bashrc)
Step 2. Refresh Your Terminal
This command applies the change immediately to your current session.
source ~/.bashrc
After this, the sourcefolio command will work.
๐ Project Structure
SourceFolio/
โโโ fetchers/ # Data fetching functions
โ โโโ news_api.py
โ โโโ openlibrary_api.py
โ โโโ wikipedia_function.py
โโโ processing/ # Supporting functions
โ โโโ config.py
โ โโโ csv_exporter.py
โ โโโ pdf_exporter.py
โ โโโ ui.py
โ โโโ utils.py
โโโ tests/ # Test files
โโโ CHANGELOG.md # Log of all version changes
โโโ LICENSE # MIT License file
โโโ main.py # Main application script
โโโ pyproject.toml # Project metadata and dependencies
โโโ README.md # This file
Tech Stack
- Python 3
- rich
- InquirerPy
- ReportLab
- wikipedia
- requests
Project Roadmap
This is the first public version of SourceFolio. I am planning on continuing to include more features in the future. Some of the planned enhancements include:
- More Data Sources: Integration with additional data sources such as academic journals and social media.
- Selective Data Output: Users will be able to choose which data sources to include in the final output.
- Command-Line Flags: The ability to use the tool directly from the command line with flags, bypassing the interactive mode.
Contributing
SourceFolio is an open-source project, and contributions are always welcome! Whether you're interested in fixing bugs, adding new features, or improving documentation, your help is appreciated.
If you'd like to contribute, please feel free to:
- Fork the repository and submit a pull request.
- Open an issue to report bugs or suggest improvements.
Every contribution, no matter how small, helps make this project better.
Acknowledgements
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sourcefolio-1.0.7.tar.gz.
File metadata
- Download URL: sourcefolio-1.0.7.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65b7b9c8936be264b03fdcf17f9af5d8e70a49f18480ee5b2c5e16a73d9ab5f8
|
|
| MD5 |
d54d4297df53b3619eaa691a1b6060d1
|
|
| BLAKE2b-256 |
63f0f7643c86fcecd86c1bae20767872b8e67a42bc369aed225ed39af7dd1f4b
|
File details
Details for the file sourcefolio-1.0.7-py3-none-any.whl.
File metadata
- Download URL: sourcefolio-1.0.7-py3-none-any.whl
- Upload date:
- Size: 20.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b94d19b26e4790b4905ff7368ef99e21320b5dbc0016845d22b3dcf6addf1592
|
|
| MD5 |
6c15ecfc5bfc3df0c78f6a2ec882d994
|
|
| BLAKE2b-256 |
36aa0bdcc01302e55ef2607b8a7b5ca55a021f433729dc79f45b8082b0f9638e
|