CLInote 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: CLInote
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Gerenciador de notas minimalista para terminal
|
|
5
|
+
Author-email: Geovani Rodrigues <geovanirodr.dev@gmail.com>
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Requires-Python: >=3.7
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Dynamic: license-file
|
|
13
|
+
|
|
14
|
+
<h1 align="center">🗒️ CLInote</h1>
|
|
15
|
+
|
|
16
|
+
📋 **Sobre**
|
|
17
|
+
|
|
18
|
+
O **CLInote** é um gerenciador de notas minimalista, focado em alta produtividade para quem vive no terminal. Desenvolvido para ser rápido, portátil e sem distrações, permitindo que você crie, liste e edite suas notas diretamente pelo seu editor favorito.
|
|
19
|
+
|
|
20
|
+
🚀 **Funcionalidades**
|
|
21
|
+
|
|
22
|
+
* **Terminal-First:** Otimizado para um fluxo de trabalho CLI ágil.
|
|
23
|
+
* **Inteligente:** Detecção automática do melhor editor disponível (Vim > Nano > Notepad).
|
|
24
|
+
* **Portátil:** Funciona nativamente em Windows, Linux e macOS.
|
|
25
|
+
* **Leve:** Sem dependências desnecessárias.
|
|
26
|
+
|
|
27
|
+
📦 **Instalação**
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install CLInote
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
🛠️ **Como usar**
|
|
34
|
+
|
|
35
|
+
Após a instalação, o comando `nc` estará disponível globalmente:
|
|
36
|
+
|
|
37
|
+
| Ação | Comando | Descrição |
|
|
38
|
+
| :--- | :--- | :--- |
|
|
39
|
+
| **Criar nota** | `nc add <nome>` | Cria uma nova nota e abre o editor. |
|
|
40
|
+
| **Listar tudo** | `nc list` | Exibe todas as suas notas salvas. |
|
|
41
|
+
| **Abrir nota** | `nc <nome>` | Abre uma nota existente para edição. |
|
|
42
|
+
| **Deletar nota** | `nc delete <id>` | Remove uma nota permanentemente. |
|
|
43
|
+
|
|
44
|
+
💻 **Configurando editores CLI (Recomendado)**
|
|
45
|
+
|
|
46
|
+
Para a experiência completa no terminal, instale o Vim ou Nano:
|
|
47
|
+
|
|
48
|
+
* **Linux:**
|
|
49
|
+
* Ubuntu/Debian: `sudo apt update && sudo apt install vim nano`
|
|
50
|
+
* Fedora: `sudo dnf install vim nano`
|
|
51
|
+
* **macOS:** `brew install vim nano`
|
|
52
|
+
* **Windows:** `winget install vim.vim nano.nano`
|
|
53
|
+
|
|
54
|
+
💡 **Filosofia do Projeto**
|
|
55
|
+
|
|
56
|
+
O **CLInote** acredita que a produtividade vem da simplicidade. O sistema buscará automaticamente o editor mais eficiente no seu ambiente. Caso nenhum editor CLI seja encontrado, o sistema utiliza o editor padrão do seu sistema operacional (Notepad).
|
|
57
|
+
|
|
58
|
+
🗂️ **Arquitetura de Dados**
|
|
59
|
+
|
|
60
|
+
Os dados são armazenados localmente de forma persistente:
|
|
61
|
+
* **Windows:** `%APPDATA%\CLInote\`
|
|
62
|
+
* **Linux/macOS:** `~/.config/CLInote/`
|
|
63
|
+
|
|
64
|
+
🛠 **Tecnologias**
|
|
65
|
+
|
|
66
|
+
* **Python 3:** Linguagem principal do projeto.
|
|
67
|
+
* **JSON:** Armazenamento leve e estruturado dos metadados.
|
|
68
|
+
* **Subprocess:** Integração segura com editores de sistema.
|
|
69
|
+
* **Shutil:** Detecção inteligente de dependências no PATH.
|
|
70
|
+
|
|
71
|
+
📄 **Licença**
|
|
72
|
+
|
|
73
|
+
MIT © Geovani Rodrigues 2026
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
notes.py,sha256=DZCuVK1uO2R4lsFK_bBIt0TUBKnVw7wsaqYKXiS0dbA,5597
|
|
2
|
+
clinote-0.1.0.dist-info/licenses/LICENSE,sha256=Q3fS13BNynRE10Ep_JnWE3SRDPBpGa-W0mX9b0uLGHk,1093
|
|
3
|
+
clinote-0.1.0.dist-info/METADATA,sha256=YYAyaFVpAiAuAV06dMEyfjc5E3T5seV0hY7atZKIaEc,2706
|
|
4
|
+
clinote-0.1.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
5
|
+
clinote-0.1.0.dist-info/entry_points.txt,sha256=Oaa7EN4fywul0cxnH6-VyCBs9e09vlmNEyI51-2MdVA,34
|
|
6
|
+
clinote-0.1.0.dist-info/top_level.txt,sha256=RE4P_72CXpYQ_1sZlIVwegyJUzmugMFcyKiu5BsQb9o,6
|
|
7
|
+
clinote-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Geovani Rodrigues
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
notes
|
notes.py
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import sys # importa o modulo sys
|
|
2
|
+
import json # importa o modulo json
|
|
3
|
+
import os # importa o modulo os
|
|
4
|
+
import subprocess # importa o modulo subprocess
|
|
5
|
+
import shutil
|
|
6
|
+
|
|
7
|
+
base_dir = os.environ.get('APPDATA') if os.name == 'nt' else os.path.expanduser('~/.config') # detecta a pasta base de usuario de forma genérica
|
|
8
|
+
PASTA_DADOS = os.path.join(base_dir, 'notesCLI') # define a pasta de dados
|
|
9
|
+
ARQUIVO_JSON = os.path.join(PASTA_DADOS, 'notas.json') #define o caminho absoluto
|
|
10
|
+
|
|
11
|
+
def exibir_rodape(): # rodapé com informações
|
|
12
|
+
print("\n © 2026 Desenvolvido por Geovani Rodrigues | notesCLI v0.1.0 \n ")
|
|
13
|
+
|
|
14
|
+
def abrir_editor(caminho):
|
|
15
|
+
editores = ['vim', 'nano', 'notepad'] #lista de editores por prioridade
|
|
16
|
+
editor_escolhido = None #inicializa a variavel como vazia
|
|
17
|
+
|
|
18
|
+
for editor in editores: # inicia um loop para verificar os editores
|
|
19
|
+
if shutil.which(editor): # verifica se o executavel do editor existe no PATH do sistema
|
|
20
|
+
editor_escolhido = editor # se achar algum editor defini como escolhido
|
|
21
|
+
break # interrompe o loop
|
|
22
|
+
|
|
23
|
+
exibir_rodape() # exibe o rodapé
|
|
24
|
+
|
|
25
|
+
if not editor_escolhido: # se não achar nenhum editor
|
|
26
|
+
print("Erro: Nenhum editor encontrado.") #mensagem de erro
|
|
27
|
+
sys.exit(1) # fecha o programa
|
|
28
|
+
|
|
29
|
+
subprocess.run([editor_escolhido, caminho], check=True) #executa o editor
|
|
30
|
+
|
|
31
|
+
def main(): # funcao principal para o pacote pip
|
|
32
|
+
if not os.path.exists(PASTA_DADOS): # se a pasta de dados nao existir
|
|
33
|
+
os.makedirs(PASTA_DADOS) # cria a pasta de dados
|
|
34
|
+
|
|
35
|
+
if len(sys.argv) < 2: # verifica se o numero de argumentos é menor que 2
|
|
36
|
+
print("Uso correto: n [add <nome> | list | delete <id> | <nome_nota>]") # exibe msg caso seja
|
|
37
|
+
sys.exit(1) # fecha o programa
|
|
38
|
+
|
|
39
|
+
comando = sys.argv[1] # pega o segundo item digitado, o comando
|
|
40
|
+
print(f" Comando recebido: {comando}")
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
with open(ARQUIVO_JSON, 'r', encoding='utf-8') as arquivo: # abre o arquivo notas.json em modo leitura
|
|
44
|
+
notas = json.load(arquivo) # carrega o arquivo json em notas
|
|
45
|
+
except (FileNotFoundError, json.JSONDecodeError): # caso o arquivo nao exista ou o arquivo nao for json
|
|
46
|
+
notas = [] # cria um array vazio
|
|
47
|
+
|
|
48
|
+
# ============ COMANDO LIST
|
|
49
|
+
if comando == 'list': # se o comando for list
|
|
50
|
+
if not notas: # se o array notas estiver vazio
|
|
51
|
+
print("Nenhuma nota encontrada.")
|
|
52
|
+
else:
|
|
53
|
+
print("\n ---MINHAS NOTAS---") # exibe o titulo na tela
|
|
54
|
+
for nota in notas: # percorre o array notas
|
|
55
|
+
print(f"ID: {nota['id']} | Nome: {nota['nome']}")
|
|
56
|
+
print("-" * 20)
|
|
57
|
+
exibir_rodape() #exibe o rodapé
|
|
58
|
+
sys.exit() # fecha o programa
|
|
59
|
+
|
|
60
|
+
# ======== COMANDO DELETE
|
|
61
|
+
if comando == 'delete': # se o comando for delete
|
|
62
|
+
if len(sys.argv) < 3:
|
|
63
|
+
print("Uso correto: n delete <id>") # mensagem de instrução caso o numero de argumentos for menor que 3
|
|
64
|
+
sys.exit(1)
|
|
65
|
+
|
|
66
|
+
id_apagar = int(sys.argv[2]) # pega o terceiro item digitado
|
|
67
|
+
notas_filtradas = [nota for nota in notas if nota['id'] != id_apagar] # filtra o array notas
|
|
68
|
+
|
|
69
|
+
if len(notas_filtradas) == len(notas): # se o tamanho do array não mudou (nada foi apagado)
|
|
70
|
+
print("Nenhuma nota encontrada com o ID fornecido.") # exibe msg
|
|
71
|
+
else:
|
|
72
|
+
with open(ARQUIVO_JSON, 'w', encoding='utf-8') as arquivo: # abre o arquivo notas.json em modo escrita
|
|
73
|
+
json.dump(notas_filtradas, arquivo, ensure_ascii=False, indent=4) # salva o array notas_filtradas no arquivo notas.json
|
|
74
|
+
print(f"Nota com o ID {id_apagar} removida com sucesso!") # mensagem de sucesso
|
|
75
|
+
exibir_rodape()
|
|
76
|
+
sys.exit()
|
|
77
|
+
|
|
78
|
+
# =========== COMANDO ADD
|
|
79
|
+
if comando == 'add': # se o comando for add
|
|
80
|
+
if len(sys.argv) < 3: # se o numero de argumentos for menor que 3
|
|
81
|
+
print("Uso correto: n add <nome_da_nota> [texto_opcional]")
|
|
82
|
+
sys.exit(1)
|
|
83
|
+
|
|
84
|
+
nome_nota = sys.argv[2] # pega o terceiro item digitado
|
|
85
|
+
caminho_txt = os.path.join(PASTA_DADOS, f"{nome_nota}.txt") # define caminho dentro da pasta de dados
|
|
86
|
+
|
|
87
|
+
nova_nota = { # cria um novo dicionario
|
|
88
|
+
"id": len(notas) + 1, # verifica o tamanho do array notas e adiciona 1 para o proximo id
|
|
89
|
+
"nome": nome_nota
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
notas.append(nova_nota) #adiciona o dicionario nova_nota ao array notas
|
|
93
|
+
|
|
94
|
+
with open(ARQUIVO_JSON, 'w', encoding='utf-8') as arquivo: # abre o notas.json em modo escrita
|
|
95
|
+
json.dump(notas, arquivo, ensure_ascii=False, indent=4) # salva o array notas no arquivo notas.json
|
|
96
|
+
|
|
97
|
+
print(f"A nota '{nome_nota}' foi registrada no notasCLI!") # exibe msg de sucesso
|
|
98
|
+
|
|
99
|
+
if not os.path.exists(caminho_txt): # se o arquivo não existir, cria um novo com um título dentro
|
|
100
|
+
with open(caminho_txt, 'w', encoding='utf-8') as f:
|
|
101
|
+
f.write(f"--- {nome_nota.upper()} ---\n\n")
|
|
102
|
+
|
|
103
|
+
abrir_editor(caminho_txt) # abre o arquivo no vim
|
|
104
|
+
sys.exit() # fecha o programa
|
|
105
|
+
|
|
106
|
+
# =========== COMANDO PARA ABRIR PELO NOME
|
|
107
|
+
caminho_txt = os.path.join(PASTA_DADOS, f"{comando}.txt") # define caminho dentro da pasta de dados
|
|
108
|
+
|
|
109
|
+
if os.path.exists(caminho_txt):
|
|
110
|
+
abrir_editor(caminho_txt)
|
|
111
|
+
else:
|
|
112
|
+
print(f"Nota '{comando}' não encontrada.")
|
|
113
|
+
sys.exit(1) # fecha o programa
|
|
114
|
+
|
|
115
|
+
if __name__ == '__main__': #verifica se o script esta sendo executado diretamente
|
|
116
|
+
main() # chama a funcao principal
|