semvec/pypi-packages huggingface dataset:
ripgreppythonfiles 0.10
Search for code in your env using ripgrep
License: MIT
Keywords: SEARCH,ripgrep,env


# Search for code in your env using ripgrep  

## Tested against Windows / Python 3.11 / Anaconda

## pip install ripgreppythonfiles


A script to search for code in your env using ripgrep  https://github.com/BurntSushi/ripgrep 


Example: 

```
(mainenv) C:\ProgramData\anaconda3\envs\mainenv>rgtt import\ numpy    #SPACES MUST BE ESCAPED!!

call python -c "from ripgreppythonfiles import rfile;rfile(r'''import\ numpy''')"
C:\ProgramData\anaconda3\envs\mainenv\bstackbin.py:1:1:import numpy as np
C:\ProgramData\anaconda3\envs\mainenv\bstackbin.py-2-import regex # pip install regex
C:\ProgramData\anaconda3\envs\mainenv\bstackbin.py-3-

C:\ProgramData\anaconda3\envs\mainenv
C:\ProgramData\anaconda3\envs\mainenv\anyarray.pyx-12-from cython.parallel cimport prange
C:\ProgramData\anaconda3\envs\mainenv\anyarray.pyx-13-cimport cython
C:\ProgramData\anaconda3\envs\mainenv\anyarray.pyx:14:1:import numpy as np
C:\ProgramData\anaconda3\envs\mainenv\anyarray.pyx:15:2:cimport numpy as np
C:\ProgramData\anaconda3\envs\mainenv\anyarray.pyx-16-import cython
C:\ProgramData\anaconda3\envs\mainenv\anyarray.pyx-17-

C:\ProgramData\anaconda3\envs\mainenv
C:\ProgramData\anaconda3\envs\mainenv\cmdaxs.py-50-
C:\ProgramData\anaconda3\envs\mainenv\cmdaxs.py-51-import pymem
C:\ProgramData\anaconda3\envs\mainenv\cmdaxs.py:52:1:import numpy as np
C:\ProgramData\anaconda3\envs\mainenv\cmdaxs.py-53-from pdmemedit import Pdmemory
C:\ProgramData\anaconda3\envs\mainenv\cmdaxs.py-54-# pass either pid or filename, but not both

.... 

Output written to: C:\Users\hansc\AppData\Local\Temp\tmpbmfm5sdo.txt
```



```python
rfile(args: str):
    Runs ripgrep with the provided arguments, printing the split arguments and calling `run_ripgrep`.

    Parameters:
        - args (str): The arguments to pass to ripgrep.

    Returns:
        None

    Obs:
        Useful when using a bat file:
        Content of rgtt.bat
            call python -c "from ripgreppythonfiles import rfile;rfile(r'''%*''')"
        Calling the bat file;
            rgtt.bat import\ numpy 5 100 1 120

run_ripgrep(
    r: str = "",
    c: int | str = 2,
    m: int | str = 1,
    s: int | str = 1,
    l: int | str = 80,
    f: str = "py,pyx",
):

    Runs ripgrep with specified parameters.

    Parameters:
        - r (str): The regular expression to search for.
        - c (in,str): The number of lines of context to display.
        - m (in,str): The maximum search depth.
        - s (in,str): If 1, writes the ripgrep output to a temporary file.
        - l (in,str): The maximum number of columns to display in the output.
        - f (str): A str of file extensions to search for (e.g, py,pyx).

    Returns:
        subprocess.CompletedProcess: The result of the ripgrep subprocess.

```
SplitticAPI 1.4.2
A Python wrapper for the SplitticAPI
License: MIT

SplitticAPI
===========

The SplitticAPI Library provides a convenient Python interface for
interacting with the Splittic API, enabling users to seamlessly
integrate Splittic's AI functionality into their applications. The
library is designed to be user-friendly and versatile, supporting both
asynchronous and synchronous programming.

Installation
------------

To install the SplitticAPI Library, use the following command:

.. code:: bash

   pip install SplitticAPI

Getting Started
---------------

1. **Obtain API Key:**

   -  Visit the `FreeAI Discord
      server <https://discord.gg/W4bwWX3HJx>`__.
   -  Retrieve your API key from the #api channel.

2. **Initialize ChatModule:**

   -  Import the ``ChatModule`` class from ``SplitticAPI.meowgpt``.
   -  Set the global API key using ``ChatModule.initialize(api_key)``.

3. **Create a Chat Instance:**

   -  Create a new chat instance using
      ``ChatModule.create_chat(api_key)``.
   -  Each instance automatically generates a unique chat ID.

4. **Send Messages:**

   -  Use the ``reply(message)`` method to send a synchronous message
      and receive a reply.
   -  Optionally, use the ``async_reply(message)`` method for
      asynchronous interactions.

5. **Generate Images with DiffusionModule:**

   -  Import the ``DiffusionModule`` class from
      ``SplitticAPI.interdiffusion``.
   -  Initialize ``DiffusionModule`` with your API key.
   -  Use the ``generate()`` method for synchronous image generation.
   -  Alternatively, use ``async_generate()`` for asynchronous image
      generation.
   -  The generated image is saved as “output.png” by default.

Example
-------

.. code:: python

   from SplitticAPI.meowgpt import ChatModule
   from SplitticAPI.interdiffusion import DiffusionModule

   # Set the global API key
   api_key = "your_api_key_here"
   ChatModule.initialize(api_key)

   # Create a ChatModule instance with a unique chat ID
   chat_instance = ChatModule.create_chat(api_key)

   # Send a synchronous message and get a reply
   def main():
       reply = chat_instance.reply("Hi")
       print(reply)

       # Generate an image synchronously
       diffusion_module = DiffusionModule(api_key)
       diffusion_module.generate("cat")

   # Run the program
   if __name__ == "__main__":
       main()

For more detailed information, refer to the `official Splittic API
documentation <https://api.splittic.app>`__.

License
-------

This library is released under the `MIT
License <https://github.com/CutyCat2000/splitticapi/blob/main/LICENSE>`__.
Feel free to use, modify, and distribute it according to your needs.