semvec/pypi-packages huggingface dataset:
gptclass 0.4.0
A Python class that does what you need
License: MIT
Requires Python: >=3.8.1,<4.0
Keywords: gpt,openai,code-generations

# GPTClass
**GPTClass** is a Python class that uses OpenAI's GPT to generated the code that does what you need with minimal information.

[![version](https://img.shields.io/pypi/v/gptclass?logo=pypi&logoColor=white)](https://pypi.org/project/gptclass/)
[![codecov](https://codecov.io/gh/jaume-ferrarons/GPTClass/branch/main/graph/badge.svg?token=IDN30YYHQ8)](https://codecov.io/gh/jaume-ferrarons/GPTClass)

### How it works?
It uses the method's name and information about the parameters used to build the source code using ChatGPT and then executes it locally.

## Installation
```bash
pip install gptclass
```

## Usage
Do whatever you need: 
```python
>>> import openai
>>> openai.api_key = "..."

>>> from gptclass import GPTClass
>>> gpt = GPTClass()

>>> gpt.add(1, 2)
3
>>> gpt.n_unique([1, 2, 5, 5])
3
>>> gpt.prime_numbers_below(10)
[2, 3, 5, 7]
>>> gpt.count_vowels("Today I had a nice coffee!")
10
>>> gpt.from_celsius_to_fahrenheit(25)
77.0
>>> gpt.random_plate_number(seed=123)
BIC6410
```

## Show me the generated code
Adding explain before invoking the method will print the code:

```python
>>> gpt.explain.from_celsius_to_fahrenheit(25)
def from_celsius_to_fahrenheit(celsius):
    return (celsius * 1.8) + 32

>>> gpt.explain.factorial(15)
def factorial(n):
    if n == 0:
        return 1
    else:
        return n * factorial(n-1)
```

## Notes
- Inspired on: [davinci-functions](https://github.com/odashi/davinci-functions/tree/main)

## Warning
- The code produced may not be reliable and should be validated before executing it.
pyinstallersubprocess 0.10
subprocess for pyinstaller
License: MIT
Keywords: subprocess,pyinstaller


# subprocess for pyinstaller 

## pip install pyinstallersubprocess

### Based on https://github.com/pyinstaller/pyinstaller/issues/6362#issuecomment-968156787

Read the post before using this module.

Here is the most important part:

```python
"Make all your entry points available as python -m invokable submodules and change all your subprocess.run(["entry_point_foo"]) usages to subprocess.run([sys.executable, "-m", "hello_word.entry_point_foo"]).
Extend those subprocess.run() calls to:
if getattr(sys, 'frozen', False):
    subprocess.run([os.path.join(sys._MEIPASS, "entry_point_foo")])
else:
    subprocess.run([sys.executable, "-m", "hello_word.entry_point_foo"])
Run PyInstaller on each entry point submodule (e.g. hello_world/hello_world/run_hello_world.py) and make use of Merge() to put them together in one bundle."
```

```python
import subprocess
from pyinstallersubprocess import (
convert_py_file_to_module,
subprocess_console,
subprocess_console_devnull,
subprocess_console_popen,
subprocess_console_stdout_read,
subprocess_no_console_devnull,
subprocess_no_console_popen,
subprocess_no_console_stdout_read)


# The function convert_py_file_to_module turns the py file into an "python -m invokable submodule"

modulename, entry = convert_py_file_to_module(
    modulename="mysubprocess", # choose what anything you want, but make sure that the folder "mysubprocess" doesn't exist in your base folder
    pythonfile=r"C:\Users\Gamer\anaconda3\envs\dfdir\pytfi.py", 
    rename_pyfile=False, # renames r"C:\Users\Gamer\anaconda3\envs\dfdir\pytfi.py" -> r"C:\Users\Gamer\anaconda3\envs\dfdir\pytfi.old"
    overwrite_existing=True, # if the folder exists 
    add_main_entry=True, # if there is no entry, 'if __name__ == "__main__" ... will be added 
)

print((modulename, entry))
('mysubprocess', 'pytfi')

# Here are some functions that take care of: "Execute the "extended" subprocess (if getattr(sys, 'frozen', False) ...)"
p = subprocess_console(
    module=modulename,
    entry=entry,
    stdout=subprocess.PIPE,
    stderr=subprocess.PIPE,
    stdin=subprocess.PIPE,
)

print(p)
# CompletedProcess(args=['C:\\Users\\Gamer\\anaconda3\\envs\\dfdir\\python.exe', '-m', 'mysubprocess.pytfi'], returncode=0, stdout=b'oioou\r\n', stderr=b'')


# All functions:

subprocess_console(module, entry, *args, **kwargs)
subprocess_console_devnull(module, entry, *args, **kwargs)
subprocess_console_popen(module, entry, *args, **kwargs)
subprocess_console_stdout_read(module, entry, *args, **kwargs)
subprocess_no_console_devnull(module, entry, *args, **kwargs)
subprocess_no_console_popen(module, entry, *args, **kwargs)
subprocess_no_console_stdout_read(module, entry, *args, **kwargs)

# This module:
# https://github.com/hansalemaos/env2installer
# can help you with "Run PyInstaller on each entry point submodule (e.g. hello_world/hello_world/run_hello_world.py)..."


```