From 2216587f70c9eb41ba161a306a9c0c5f7c0ff8ce Mon Sep 17 00:00:00 2001 From: Eli <43382407+eli64s@users.noreply.github.com> Date: Mon, 23 Oct 2023 05:22:04 -0500 Subject: [PATCH] Update local repo paths, now set relative to parent directory. --- pyproject.toml | 2 +- readme-ai.md | 233 ++++++++++++++++++++++++++++++++++ readmeai/markdown/headers.py | 6 +- readmeai/settings/config.toml | 8 +- readmeai/utils/utils.py | 8 +- 5 files changed, 249 insertions(+), 8 deletions(-) create mode 100644 readme-ai.md diff --git a/pyproject.toml b/pyproject.toml index 6fe14740..29c44d5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "readmeai" -version = "0.4.039" +version = "0.4.042" description = "Generate beautiful README.md files from the terminal, powered by AI." authors = ["Eli <0x.eli.64s@gmail.com>"] license = "MIT" diff --git a/readme-ai.md b/readme-ai.md new file mode 100644 index 00000000..de1bd420 --- /dev/null +++ b/readme-ai.md @@ -0,0 +1,233 @@ +
+

+ +
FLINK-FLOW

+

โ—ฆ โ–บ INSERT-TEXT

+

โ—ฆ Developed with the software and tools below.

+ +

+GNU%20Bash +Apache%20Flink +YAML +Python +AIOHTTP +Apache%20Kafka +pandas +

+
+ +--- + +## ๐Ÿ“– Table of Contents +- [๐Ÿ“– Table of Contents](#-table-of-contents) +- [๐Ÿ“ Overview](#-overview) +- [๐Ÿ“ฆ Features](#-features) +- [๐Ÿ“‚ repository Structure](#-repository-structure) +- [โš™๏ธ Modules](#modules) +- [๐Ÿš€ Getting Started](#-getting-started) + - [๐Ÿ”ง Installation](#-installation) + - [๐Ÿค– Running flink-flow](#-running-flink-flow) + - [๐Ÿงช Tests](#-tests) +- [๐Ÿ›ฃ Roadmap](#-roadmap) +- [๐Ÿค Contributing](#-contributing) +- [๐Ÿ“„ License](#-license) +- [๐Ÿ‘ Acknowledgments](#-acknowledgments) + +--- + + +## ๐Ÿ“ Overview + +โ–บ INSERT-TEXT + +--- + +## ๐Ÿ“ฆ Features + +โ–บ INSERT-TEXT + +--- + + +## ๐Ÿ“‚ Repository Structure + +```sh +โ””โ”€โ”€ flink-flow/ + โ”œโ”€โ”€ .benchmarks/ + โ”œโ”€โ”€ blog/ + โ”œโ”€โ”€ conf/ + โ”‚ โ”œโ”€โ”€ conf.toml + โ”‚ โ””โ”€โ”€ flink-config.yaml + โ”œโ”€โ”€ requirements.txt + โ”œโ”€โ”€ scripts/ + โ”‚ โ”œโ”€โ”€ clean.sh + โ”‚ โ””โ”€โ”€ run.sh + โ”œโ”€โ”€ setup/ + โ”‚ โ””โ”€โ”€ setup.sh + โ”œโ”€โ”€ setup.py + โ””โ”€โ”€ src/ + โ”œโ”€โ”€ alerts_handler.py + โ”œโ”€โ”€ consumer.py + โ”œโ”€โ”€ logger.py + โ””โ”€โ”€ twitter.py + +``` + +--- + + +## โš™๏ธ Modules + +
Root + +| File | Summary | +| --- | --- | +| [requirements.txt]({file}) | โ–บ INSERT-TEXT | +| [setup.py]({file}) | โ–บ INSERT-TEXT | + +
+ +
Setup + +| File | Summary | +| --- | --- | +| [setup.sh]({file}) | โ–บ INSERT-TEXT | + +
+ +
Scripts + +| File | Summary | +| --- | --- | +| [run.sh]({file}) | โ–บ INSERT-TEXT | +| [clean.sh]({file}) | โ–บ INSERT-TEXT | + +
+ +
Conf + +| File | Summary | +| --- | --- | +| [flink-config.yaml]({file}) | โ–บ INSERT-TEXT | +| [conf.toml]({file}) | โ–บ INSERT-TEXT | + +
+ +
Src + +| File | Summary | +| --- | --- | +| [alerts_handler.py]({file}) | โ–บ INSERT-TEXT | +| [logger.py]({file}) | โ–บ INSERT-TEXT | +| [consumer.py]({file}) | โ–บ INSERT-TEXT | +| [twitter.py]({file}) | โ–บ INSERT-TEXT | + +
+ +--- + +## ๐Ÿš€ Getting Started + +***Dependencies*** + +Please ensure you have the following dependencies installed on your system: + +`- โ„น๏ธ Dependency 1` + +`- โ„น๏ธ Dependency 2` + +`- โ„น๏ธ ...` + +### ๐Ÿ”ง Installation + +1. Clone the flink-flow repository: +```sh +git clone /Users/k01101011/Documents/GitHub/flink-flow +``` + +2. Change to the project directory: +```sh +cd flink-flow +``` + +3. Install the dependencies: +```sh +pip install -r requirements.txt +``` + +### ๐Ÿค– Running flink-flow + +```sh +python main.py +``` + +### ๐Ÿงช Tests +```sh +pytest +``` + +--- + + +## ๐Ÿ›ฃ Project Roadmap + +> - [X] `โ„น๏ธ Task 1: Implement X` +> - [ ] `โ„น๏ธ Task 2: Implement Y` +> - [ ] `โ„น๏ธ ...` + + +--- + +## ๐Ÿค Contributing + +Contributions are welcome! Here are several ways you can contribute: + +- **[Submit Pull Requests](https://github.com/local/flink-flow/blob/main/CONTRIBUTING.md)**: Review open PRs, and submit your own PRs. +- **[Join the Discussions](https://github.com/local/flink-flow/discussions)**: Share your insights, provide feedback, or ask questions. +- **[Report Issues](https://github.com/local/flink-flow/issues)**: Submit bugs found or log feature requests for LOCAL. + +#### *Contributing Guidelines* + +
+Click to expand + +1. **Fork the Repository**: Start by forking the project repository to your GitHub account. +2. **Clone Locally**: Clone the forked repository to your local machine using a Git client. + ```sh + git clone + ``` +3. **Create a New Branch**: Always work on a new branch, giving it a descriptive name. + ```sh + git checkout -b new-feature-x + ``` +4. **Make Your Changes**: Develop and test your changes locally. +5. **Commit Your Changes**: Commit with a clear and concise message describing your updates. + ```sh + git commit -m 'Implemented new feature x.' + ``` +6. **Push to GitHub**: Push the changes to your forked repository. + ```sh + git push origin new-feature-x + ``` +7. **Submit a Pull Request**: Create a PR against the original project repository. Clearly describe the changes and their motivations. + +Once your PR is reviewed and approved, it will be merged into the main branch. + +
+ +--- + +## ๐Ÿ“„ License + + +This project is protected under the [SELECT-A-LICENSE](https://choosealicense.com/licenses) License. For more details, refer to the [LICENSE](https://choosealicense.com/licenses/) file. + +--- + +## ๐Ÿ‘ Acknowledgments + +- List any resources, contributors, inspiration, etc. here. + +[**Return**](#Top) + +--- diff --git a/readmeai/markdown/headers.py b/readmeai/markdown/headers.py index 99d45666..1ed33086 100644 --- a/readmeai/markdown/headers.py +++ b/readmeai/markdown/headers.py @@ -56,7 +56,9 @@ def format_readme_md_contents( else: badge_icons = badges.get_app_icons(conf, packages) - md_setup_guide = quickstart.create_instructions(conf, helper, summaries) + repo_path = f"../{repo_name}" if conf.git.source == "local" else repository + instructions = quickstart.create_instructions(conf, helper, summaries) + md_quickstart = conf.md.setup.format(repo_name, repo_path, *instructions) markdown_sections = [ conf.md.header, @@ -66,7 +68,7 @@ def format_readme_md_contents( conf.md.tree, conf.md.modules, md_summary_tables, - conf.md.setup.format(repo_name, repository, *md_setup_guide), + md_quickstart, conf.md.contribute.format(full_name, name.upper()), ] diff --git a/readmeai/settings/config.toml b/readmeai/settings/config.toml index e3d1e12d..b2ba7312 100644 --- a/readmeai/settings/config.toml +++ b/readmeai/settings/config.toml @@ -3,10 +3,10 @@ endpoint = "https://api.openai.com/v1/chat/completions" encoding = "cl100k_base" model = "gpt-3.5-turbo" -rate_limit = 3 -tokens = 700 -tokens_max = 4000 -temperature = 1.0 +rate_limit = 5 +tokens = 669 +tokens_max = 3999 +temperature = 1.05 # CLI Options [cli] diff --git a/readmeai/utils/utils.py b/readmeai/utils/utils.py index 62deacc1..88d3d5b4 100644 --- a/readmeai/utils/utils.py +++ b/readmeai/utils/utils.py @@ -56,6 +56,12 @@ def format_sentence(text: str) -> str: return text.strip().strip('"') +def get_relative_path(absolute_path: str, base_path: str) -> str: + """Get the relative path of a file.""" + absolute_path = Path(absolute_path) + return absolute_path.relative_to(base_path) + + def remove_substring(input_string: str) -> str: """Remove text between HTML tags.""" pattern = r"

.*?" @@ -73,7 +79,7 @@ def should_ignore(conf_helper: ConfigHelper, file_path: Path) -> bool: directory in file_path.parts for directory in ignore_files["directories"] ): - logger.debug(f"Ignoring directory: {file_path}") + logger.debug(f"Ignoring path: {file_path.suffix}") return True if file_path.name in ignore_files["files"]: