47 lines
2.6 KiB
Python
47 lines
2.6 KiB
Python
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker, Session
|
|
from .config import settings
|
|
from .models import Hard_skills
|
|
|
|
DATABASE_URL = f'postgresql://{settings.database_username}:{settings.database_password}@{settings.database_hostname}:{settings.database_port}/{settings.database_name}'
|
|
|
|
engine = create_engine(DATABASE_URL)
|
|
|
|
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
|
|
|
|
def get_db():
|
|
db = SessionLocal()
|
|
|
|
try:
|
|
yield db
|
|
finally:
|
|
db.close()
|
|
|
|
def init_db(session: Session):
|
|
|
|
titles = [
|
|
'C', 'C++', 'C#', 'Java', 'Python', 'Ruby', 'Ruby on Rails', 'R', 'Matlab', 'Django', 'NetBeans',
|
|
'Scala', 'JavaScript', 'TypeScript', 'Go', 'Software Development', 'Application Development',
|
|
'Web Applications', 'Object Oriented Programming', 'Aspect Oriented Programming', 'Concurrent Programming',
|
|
'Mobile Development (iOS)', 'Mobile Development (Android)', 'Data Science', 'Data Analytics', 'Data Mining',
|
|
'Data Visualization', 'Machine Learning', 'TensorFlow', 'PyTorch', 'Keras', 'Theano', 'Statistical Analysis',
|
|
'Bayesian Analysis', 'Regression Analysis', 'Time Series Analysis', 'Clustering', 'K-means', 'KNN', 'Decision Trees',
|
|
'Random Forest', 'Dimensionality Reduction', 'PCA', 'SVD', 'Gradient Descent', 'Stochastic Gradient Descent',
|
|
'Outlier Detection', 'Frequent Itemset Mining', 'SQL', 'NoSQL', 'SQL Server', 'MS SQL Server', 'Apache Hadoop',
|
|
'Apache Spark', 'Apache Airflow', 'Apache Impala', 'Apache Drill', 'HTML', 'CSS', 'React', 'Angular', 'Vue.js',
|
|
'Node.js', 'Express.js', 'REST', 'SOAP', 'Web Platforms', 'System Architecture', 'Distributed Computing', 'AWS',
|
|
'AWS Glue', 'Azure', 'Google Cloud Platform', 'Docker', 'Kubernetes', 'UNIX', 'Linux', 'Windows', 'MacOS',
|
|
'Embedded Hardware', 'Debugging', 'Unit Testing', 'Integration Testing', 'System Testing', 'Code Review', 'Git',
|
|
'SVN', 'CI/CD', 'Software Documentation', 'IDE', 'CASE Tools', 'Computational Complexity', 'Algorithm Design',
|
|
'Data Structures', 'Mathematical Modeling', 'Statistics', 'Technical Writing', 'Technical Support', 'System Design',
|
|
'System Development', 'Technical Guidance', 'Client Interface', 'Vendor Interface', 'Emerging Technologies', 'Jira',
|
|
'Trello', 'Software Architecture', 'Word', 'Excel'
|
|
]
|
|
|
|
for title in titles:
|
|
exist_hardskill = session.query(Hard_skills).filter(Hard_skills.Title == title).first()
|
|
|
|
if not exist_hardskill:
|
|
hard_skills_object = Hard_skills(Title=title)
|
|
session.add(hard_skills_object)
|
|
session.commit() |