Skip to content

Commit

Permalink
Merge pull request #14 from ben05allen/adding-project-files
Browse files Browse the repository at this point in the history
adding project files
  • Loading branch information
rohitagr0310 authored Oct 11, 2023
2 parents 026cb9f + fbac0ce commit 75e329d
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 6 deletions.
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*.pyo
*.egg-info/
*.egg

# C extensions
*.so

# Distribution / packaging
.Python
.venv/
venv/
.vscode/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/
.pytest_cache/

# Jupyter Notebook
.ipynb_checkpoints

# IDEs and editors
# VSCode
.vscode/
# PyCharm
.idea/

# Operating systems
*.swp
*.swo
.DS_Store
._*
.Spotlight-V100
.Trashes

# Custom exclusions
# You can add custom exclusions specific to your project here
# e.g., exclude a secrets file
# secrets.yml
10 changes: 4 additions & 6 deletions create_dat.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
from fake import Faker
from faker import Faker
from models import Student
import random
import pickle

class Student:
def __init__(self, roll, name, percentage):
self.roll = roll
self.name = name
self.percentage = percentage

def generate_fake_records(n):
fake = Faker()
Expand All @@ -22,6 +18,7 @@ def generate_fake_records(n):

return records


def save_to_dat(records):
try:
with open("fake_stud.dat", "wb") as file:
Expand All @@ -31,6 +28,7 @@ def save_to_dat(records):
except Exception as e:
print(f"Error: {e}")


if __name__ == "__main__":
n = int(input("Enter the number of fake records to generate: "))
fake_records = generate_fake_records(n)
Expand Down
5 changes: 5 additions & 0 deletions models.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Student:
def __init__(self, roll, name, percentage):
self.roll = roll
self.name = name
self.percentage = percentage
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Faker

0 comments on commit 75e329d

Please sign in to comment.