Compare commits

...

13 Commits

Author SHA1 Message Date
Gustavo Henrique Miranda 4d3606b197
Merge pull request #10 from gmbrax/feat/Database-Integration
Feat/database integration
2025-06-26 03:41:42 -03:00
Gustavo Henrique Santos Souza de Miranda b50507ae18 Merge branch 'refactor/refactor-fix' into development
# Conflicts:
#	.gitignore
#	.idea/workspace.xml
#	requirements.txt
2025-06-26 03:35:07 -03:00
Gustavo Henrique Santos Souza de Miranda 7b13982391 Revert "🎨refactor: move modules and refactor import statements"
This reverts commit 99eb0a0651.
2025-06-25 22:34:19 -03:00
Gustavo Henrique Santos Souza de Miranda d206abf016 Revert "♻️ refactor: remove unnecessary blank lines and adjust package path in pyproject.toml"
This reverts commit 8665b6f47b.
2025-06-25 22:30:18 -03:00
Gustavo Henrique Santos Souza de Miranda f1195391db Started integrating the database to the UI so it can save the data into the database 2025-06-25 14:58:54 -03:00
Gustavo Henrique Miranda 4a5da4d44c
Merge pull request #5 from gmbrax/feat-TUI
Feat t UI
2025-06-25 04:06:01 -03:00
Matheus Toledo 8665b6f47b ♻️ refactor: remove unnecessary blank lines and adjust package path in pyproject.toml 2025-06-16 15:08:13 -03:00
Matheus Toledo 99eb0a0651 🎨refactor: move modules and refactor import statements 2025-06-16 12:43:39 -03:00
Matheus Toledo dec8a7b445 ♻️ refactor: remove intelliJ files 2025-06-16 12:33:30 -03:00
Matheus Toledo 83f6d15ba9 🙈 feat: update .gitignore to include IDE settings for VS Code and IntelliJ 2025-06-16 12:32:43 -03:00
Matheus Toledo 190cef2627 📝 docs: update README with project overview, features, requirements, installation, and usage instructions 2025-06-16 12:31:05 -03:00
Matheus Toledo c2f95b1cf2 ♻️refactor: remove blank lines on dependencies file 2025-06-16 12:09:02 -03:00
Matheus Toledo 9024d30662 🙈 feat: update gitignore for python projects 2025-06-16 12:08:01 -03:00
11 changed files with 206 additions and 44 deletions

145
.gitignore vendored
View File

@ -1,3 +1,144 @@
# Database files
database.db
__pycache__
/.idea/
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# 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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
build/
temp/
# PyBuilder
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
.python-version
# pipenv
Pipfile.lock
# poetry
poetry.lock
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.env.*
.venv
venv/
ENV/
env/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# IDE settings
.vscode/
.idea/

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/.venv" />
</content>
<orderEntry type="jdk" jdkName="Python 3.10 (Pilgrim)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -1,6 +0,0 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Pilgrim.iml" filepath="$PROJECT_DIR$/.idea/Pilgrim.iml" />
</modules>
</component>
</project>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

View File

@ -1,3 +1,50 @@
# Python_Pilgrim
Python Based Travel Diary
## Overview
**Python_Pilgrim** is a Python-based travel diary application designed to help users document and manage their travel experiences. The project provides tools for recording trips, organizing travel notes, and storing memories in a structured and accessible format.
## Features
- Create and manage travel diaries
- Add, edit, and delete travel entries
- Organize trips by date, location, or theme
- Store photos, notes, and other media
- Export and share travel logs
## Requirements
- Python 3.8 or higher
- Linux operating system (tested on Ubuntu 20.04+)
- Visual Studio Code (VSCode) for development (optional but strongly recommended)
- pip (Python package installer)
- Optional: virtualenv for isolated environments
## Installation
1. Clone the repository:
```bash
git clone https://github.com/gmbrax/Pilgrim.git
```
2. Navigate to the project directory:
```bash
cd Pilgrim
```
3. Create a virtual environment and, then, activate it:
```bash
python -m venv .venv
source .venv/bin/activate
```
4. Install the required dependencies:
```bash
pip install -r requirements.txt
```
## Usage
To run the main application, execute:
```bash
python <???>.py
```
This will start the Python_Pilgrim application. Follow the on-screen instructions to create and manage your travel diaries.

View File

@ -7,7 +7,10 @@ from pilgrim.ui.ui import UIApp
class Application:
def __init__(self):
self.database = Database()
self.ui = UIApp(ServiceManagerMock())
session = self.database.session()
session_manager = ServiceManager()
session_manager.set_session(session)
self.ui = UIApp(session_manager)
def run(self):
self.database.create()

View File

@ -1,5 +1,4 @@
from typing import List
from ..models.entry import Entry
from ..models.travel_diary import TravelDiary

View File

@ -1,10 +1,10 @@
from ..models.travel_diary import TravelDiary
import asyncio
class TravelDiaryService:
def __init__(self,session):
self.session = session
def create(self, name:str):
async def async_create(self, name:str):
new_travel_diary = TravelDiary(name)
self.session.add(new_travel_diary)
self.session.commit()
@ -18,14 +18,17 @@ class TravelDiaryService:
def read_all(self):
return self.session.query(TravelDiary).all()
def update(self, travel_diary_id: TravelDiary, travel_diary_dst: TravelDiary):
original = self.read_by_id(travel_diary_id.id)
def update(self, travel_diary_id: int, name: str):
original = self.read_by_id(travel_diary_id)
if original is not None:
original.name = travel_diary_dst.name
original.name = name
self.session.commit()
self.session.refresh(original)
return original
async def async_update(self, travel_diary_id: int, name: str):
return self.update(travel_diary_id, name)
def delete(self, travel_diary_id: TravelDiary):
excluded = self.read_by_id(travel_diary_id.id)
if excluded is not None:

View File

@ -127,8 +127,8 @@ class DiaryListScreen(Screen):
service_manager = self.app.service_manager
travel_diary_service = service_manager.get_travel_diary_service()
# Uses async method
diaries = await travel_diary_service.async_read_all()
# Usa método síncrono agora
diaries = travel_diary_service.read_all()
# Saves current state
current_diary_id = None

View File

@ -387,4 +387,4 @@ Screen.-modal {
.RenameEntryModal-cancel-button {
margin: 0 1;
width: 1fr;
}
}