Skip to content

added setup.py + merged folders #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
.DS_Store
.DS_Store?
._*

# Byte-compiled / optimized / DLL files
**/__pycache__/
*.py[cod]
*$py.class

# Distribution / packaging
.Python
build/
dist/
*.egg-info/
*.egg
MANIFEST

docs/build/
docs/source/_templates/
.env
Expand Down
34 changes: 34 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Include the license file
include LICENSE

# Include the readme and other markdown files
include README.md
include CONTRIBUTING.md

# Include the requirements file
include requirements.txt

# Include the setup configuration
include setup.py

# Include the documentation files
recursive-include docs *.md
recursive-include docs *.rst

# Include the YAML configuration for Read the Docs
include readthedocs.yml

# Include Python source files from the project's subpackages
recursive-include utils *.py
recursive-include examples *.py
recursive-include tests *.py

# If you want to exclude specific files or patterns, use the 'global-exclude' directive
# global-exclude *.pyc
# global-exclude __pycache__/*

# Exclude all bytecode compiled files
global-exclude *.py[cod]

# Exclude OS generated files like .DS_Store
global-exclude .DS_Store
Empty file removed classes/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion examples/html_scraping.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import sys
from classes.class_generator import Generator
from utils.class_generator import Generator

values = [
{
Expand Down
2 changes: 1 addition & 1 deletion examples/values_scraping.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from classes.class_generator import Generator
from utils.class_generator import Generator

from utils.getter import get_function, scraper

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ langchain_core==0.1.16
langchain_openai==0.0.5
python-dotenv==1.0.1
Requests==2.31.0
pytest==8.0.0
pytest==8.0.0
24 changes: 24 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from setuptools import setup, find_packages

# Read in the requirements.txt file
with open('requirements.txt') as f:
requirements = f.read().splitlines()

setup(
name='amazscraper',
version='1.0.0', # MAJOR.MINOR.PATCH
description='A web scraping library using langchain',
author='Marco Vinciguerra',
author_email='[email protected]',
packages=find_packages(),
install_requires=requirements,
# Include package data files from MANIFEST.in
include_package_data=True,
license='Apache 2.0',
# Additional classifiers to help users find the package
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
],
)
2 changes: 1 addition & 1 deletion tests/test_amaz_scraper.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pytest
from classes.pydantic_class import _Response
from utils.pydantic_class import _Response
from utils.class_creator import create_class
from langchain_openai import ChatOpenAI

Expand Down
2 changes: 1 addition & 1 deletion utils/class_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ def create_class(data_dict: dict):
global base_script
base_script = base_script + f" {elem['title']}: {elem['type']} = Field(description='{elem['description']}')\n"

with open("classes/pydantic_class.py", "w") as f:
with open("./pydantic_class.py", "w") as f:
f.write(base_script)
4 changes: 2 additions & 2 deletions classes/class_generator.py → utils/class_generator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from dotenv import load_dotenv
from classes.pydantic_class import _Response
from utils.class_creator import create_class
from .pydantic_class import _Response
from .class_creator import create_class
from langchain_openai import ChatOpenAI
from langchain.prompts import PromptTemplate
from langchain_core.pydantic_v1 import Field
Expand Down
File renamed without changes.