Getting Started¶
1. Installation¶
octopolars is on PyPI. Install with:
Using uv (optional)
If you set up uv (recommended for a smoother developer experience), you can install with:
or set up a project (e.g.,uv init --app --package, uv venv, then activate the venv), and add octopolars:
2. Usage¶
octopolars provides a CLI tool called octopols. To list a user’s GitHub repositories:
To apply filters or walk files instead of list repos, add flags. For example:
This will list only files from repositories whose name starts with "d3".
More CLI Examples¶
- List repos with a name filter:
- List files non-recursively:
- List all files, output to CSV:
For advanced usage like limiting rows/columns, see the CLI reference.
3. Local Development¶
- Clone the Repo:
- Install Dependencies: - If you’re using pdm: - Otherwise, standard pip:
-
Optional: Pre-commit Hooks:
This automatically runs lint checks (e.g., black, flake8) before each commit. -
Run Tests (if applicable):
- Build/Serve Docs (if included):
Then visit the local server link. Use
mkdocs gh-deployto publish on GitHub Pages.
4. Example Workflow¶
- List Repositories:
- Apply a Filter:
- Switch to Files:
- Combine Steps: This filters file trees in each repository for Markdown files.
5. Configuration¶
octopolars primarily relies on:
- GH_TOKEN: Recommended to avoid low rate limits, or else requires gh to be installed.
- Caching: By default, it caches your repos in a user-specific cache directory.
- CLI Flags: Control recursion, output format, table dimensions, and more via flags:
- --rows, --cols, --quiet: Manage table display size.
- --filter: Apply a Polars-based filter or DSL expression.
For further details, consult the API Reference or the help text: