Skip to content

refactor/Docs update readmes#23

Merged
leo-gan merged 2 commits intoleo-gan:mainfrom
LeoGan:docs-update-readmes
Oct 2, 2025
Merged

refactor/Docs update readmes#23
leo-gan merged 2 commits intoleo-gan:mainfrom
LeoGan:docs-update-readmes

Conversation

@leo-gan
Copy link
Owner

@leo-gan leo-gan commented Oct 2, 2025

No description provided.

google-labs-jules bot and others added 2 commits October 2, 2025 02:08
This commit refactors the README files to align with the project's new monorepo structure.

The root README.md has been made more concise, providing a high-level overview of the project and linking to the package-specific READMEs for more detailed information.

The README.md files for the `pdf-anonymizer-core` and `pdf-anonymizer-cli` packages have been updated to provide more focused installation and usage instructions relevant to their respective packages within the monorepo.
@gemini-code-assist
Copy link

Summary of Changes

Hello @leo-gan, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a comprehensive refactor and update of the project's documentation across its main README and the READMEs for the pdf-anonymizer-cli and pdf-anonymizer-core packages. The changes aim to improve the clarity, conciseness, and overall organization of the documentation, making it easier for users and developers to understand the project's structure and how to interact with its components. Detailed explanations and examples have been strategically relocated or simplified to enhance readability and maintain a consistent information flow.

Highlights

  • Main README Restructure: The primary README.md has been significantly condensed and reorganized to provide a high-level overview of the project's features and its monorepo structure, directing users to specific package READMEs for detailed usage.
  • CLI Documentation Update: The packages/pdf-anonymizer-cli/README.md has been updated with clearer installation instructions, refined environment variable guidance, and streamlined usage examples, focusing on the command-line interface.
  • Core Library Documentation Update: The packages/pdf-anonymizer-core/README.md now offers a more concise overview of the core library's purpose, simplified development installation steps, and clearer API usage examples for programmatic integration.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@leo-gan leo-gan merged commit 9a83611 into leo-gan:main Oct 2, 2025
2 checks passed
@leo-gan leo-gan deleted the docs-update-readmes branch October 2, 2025 02:25
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the documentation to better align with the project's monorepo structure. The changes significantly improve the organization by moving detailed information from the root README.md to the respective package READMEs. While this is a good direction, the simplification has led to the omission of some critical user information and introduced an error in a code example. My review focuses on restoring the missing details regarding output files and logging, correcting the inaccurate environment setup instructions, and fixing the broken code example in the core library's documentation.

Comment on lines +33 to +42
# Example of programmatic usage
text, mapping = anonymize_file(
file_path="/path/to/file.pdf",
characters_to_anonymize=100_000,
prompt_template=detailed.prompt_template,
model_name="gemini-2.5-flash", # or local models like "gemma:7b", "phi4-mini"
anonymized_entities=None, # or list like ["PERSON", "EMAIL"]
model_name="gemini-2.5-flash"
)

if text and mapping:
print("Anonymized Text:", text)
print("Mapping:", mapping)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This code example for anonymize_file is incorrect and will raise a TypeError because the required characters_to_anonymize argument is missing.

Additionally, the example doesn't clarify the structure of the returned mapping dictionary (original -> placeholder), which is crucial for developers using this function. The previous README version contained this information, and it should be restored.

Suggested change
# Example of programmatic usage
text, mapping = anonymize_file(
file_path="/path/to/file.pdf",
characters_to_anonymize=100_000,
prompt_template=detailed.prompt_template,
model_name="gemini-2.5-flash", # or local models like "gemma:7b", "phi4-mini"
anonymized_entities=None, # or list like ["PERSON", "EMAIL"]
model_name="gemini-2.5-flash"
)
if text and mapping:
print("Anonymized Text:", text)
print("Mapping:", mapping)
# Example of programmatic usage
text, mapping = anonymize_file(
file_path="/path/to/file.pdf",
characters_to_anonymize=100_000, # This argument is required
prompt_template=detailed.prompt_template,
model_name="gemini-2.5-flash"
)
if text and mapping:
print("Anonymized Text:", text)
# Note: mapping is original -> placeholder
print("Mapping:", mapping)

## Environment Variables

- `packages/pdf-anonymizer-cli/.env`
The CLI will automatically load a `.env` file from the current directory or any parent directory. For consistency, it's recommended to place a single `.env` file at the root of the repository.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description of how the .env file is loaded is misleading. The cli.py code explicitly loads the .env file from the packages/pdf-anonymizer-cli directory; it does not search parent directories. This documentation should be updated to reflect the actual behavior to avoid user confusion.

Suggested change
The CLI will automatically load a `.env` file from the current directory or any parent directory. For consistency, it's recommended to place a single `.env` file at the root of the repository.
The CLI loads environment variables from a `.env` file located in the `packages/pdf-anonymizer-cli` directory.

# OLLAMA_HOST="http://localhost:11434"
```

## Usage

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Usage section is missing key information about where the output files are stored for both run and deanonymize commands. This was present in the previous documentation and is crucial for users. Please add 'Outputs' subsections to both Anonymize and Deanonymize sections detailing the file paths (e.g., data/anonymized, data/mappings, data/deanonymized, data/stats).


- For Google models, ensure `GOOGLE_API_KEY` is set; otherwise the command will exit with an error.
- Logs are written to `app.log` alongside console output.
This will create a deanonymized version of the file at `data/deanonymized/document.deanonymized.md`. No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The previous documentation mentioned that logs are written to app.log. This is valuable information for users who might need to debug issues. I recommend adding a 'Notes' section at the end of the file to include this. For example:

Notes

  • Logs are written to app.log in the current working directory.

- Local models use `ollama`. Ensure the model is pulled/running (e.g., `ollama pull phi`).
print(f"Default model: {DEFAULT_MODEL_NAME}")
print(f"Available Google models: {[m.value for m in ModelName if 'gemini' in m.value]}")
``` No newline at end of file

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The previous 'Notes' section contained useful information for developers using this core library, such as the underlying PDF parsing library and the need to pull Ollama models manually. This context is valuable and I recommend adding it back at the end of the file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant