Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lexhouk/goit-pyweb-hw-02

Модуль 2. Python Development
https://github.com/lexhouk/goit-pyweb-hw-02

colorama colorama-librairy docker docker-image dockerfile goit goit-pyweb-hw-02 pip pip3 poetry poetry-python python-virtual-environment studying

Last synced: about 1 month ago
JSON representation

Модуль 2. Python Development

Awesome Lists containing this project

README

        

# Assistant bot

## Pre-installation

```bash
$ pip[3] install poetry
$ poetry config virtualenvs.in-project true
```

## Installation

```bash
$ git clone https://github.com/lexhouk/goit-pyweb-hw-02.git goit-pyweb-hw-02
$ cd goit-pyweb-hw-02
$ poetry shell
$ poetry install
```

## Usage

```bash
$ python main.py
```

or with debug:

```bash
$ python main.py --debug
```

## Classes diagram

```mermaid
classDiagram
Field <|--* Name
Field <|--* Phone
Field <|--* Birthday

Name <|--* Record
Phone "0..*" <|--o "1" Record
Birthday <|--o Record

UserDict <|-- AddressBook
Record "0..*" <|--o "1" AddressBook

Exception <|-- PhoneError
Exception <|-- BirthdayError
Exception <|-- RecordError

ABC <|-- Reader
Reader <|-- CliReader

ABC <|-- Writer
Writer <|-- CliWriter

class Field {
<>
+str value
+__init__(str value) None
+__str__() str
}

Phone: +__init__(str value) None

class Birthday {
+str FORMAT
+__init__(str value) None
+__str__() str
}

class Record {
+Name name
+list~Phone~ phones
+Birthday|None birthday
+__init__(str name) None
+__str__() str
#find(str phone, bool get_instance) int | Phone | None
+add_phone(str phone) None
+remove_phone(str phone) None
+edit_phone(str current, str new) None
+find_phone(str phone) Phone | None
+add_birthday(str birthday) None
}

class UserDict {
<>
}

class AddressBook {
+data: Dict[str, Record]
+add_record(Record record) None
+find(str name) Record
+delete(str name) None
date_to_string(datetime.datetime date) str$
find_next_weekday(datetime.datetime start_date, int weekday) datetime.datetime$
+adjust_for_weekend(datetime.datetime birthday) datetime.datetime
+get_upcoming_birthdays(int days) Dict[str, list[str]]
}

class Exception {
<>
}

PhoneError: +__init__() None
BirthdayError: +__init__() None

class RecordError {
+str MESSAGE
+__init__() None
}

class ABC {
<>
}

class Reader {
<>
-prompt
+__init__(str prompt) None
read() tuple~str~*
}

CliReader: +read() tuple~str~

class Writer {
<>
write(str data) None*
}

class CliWriter {
+__init__() None
+write(str data) None
}
```