id
int64
0
458k
file_name
stringlengths
4
119
file_path
stringlengths
14
227
content
stringlengths
24
9.96M
size
int64
24
9.96M
language
stringclasses
1 value
extension
stringclasses
14 values
total_lines
int64
1
219k
avg_line_length
float64
2.52
4.63M
max_line_length
int64
5
9.91M
alphanum_fraction
float64
0
1
repo_name
stringlengths
7
101
repo_stars
int64
100
139k
repo_forks
int64
0
26.4k
repo_open_issues
int64
0
2.27k
repo_license
stringclasses
12 values
repo_extraction_date
stringclasses
433 values
14,500
ansible_pytest_collections.py
ansible_ansible/test/lib/ansible_test/_util/target/pytest/plugins/ansible_pytest_collections.py
"""Enable unit testing of Ansible collections. PYTEST_DONT_REWRITE""" from __future__ import annotations import os # set by ansible-test to a single directory, rather than a list of directories as supported by Ansible itself ANSIBLE_COLLECTIONS_PATH = os.path.join(os.environ['ANSIBLE_COLLECTIONS_PATH'], 'ansible_coll...
4,997
Python
.pyt
81
54.679012
150
0.724667
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,501
uninstall-Alpine-3-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/uninstall-Alpine-3-python-3.yml
- name: Uninstall Paramiko for Python 3 on Alpine command: apk del py3-paramiko
82
Python
.pyt
2
39
49
0.7875
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,502
uninstall-RedHat-8-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/uninstall-RedHat-8-python-3.yml
- name: Uninstall Paramiko for Python 3 on RHEL 8 pip: # no python3-paramiko package exists for RHEL 8 name: paramiko state: absent
142
Python
.pyt
4
32
54
0.73913
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,503
uninstall-zypper-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/uninstall-zypper-python-3.yml
- name: Uninstall Paramiko for Python 3 using zypper command: zypper --quiet --non-interactive remove --clean-deps python3-paramiko
134
Python
.pyt
2
65
80
0.787879
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,504
uninstall-Darwin-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/uninstall-Darwin-python-3.yml
- name: Uninstall Paramiko for Python 3 on MacOS pip: name: paramiko state: absent
93
Python
.pyt
4
19.75
48
0.719101
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,505
install-Alpine-3-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/install-Alpine-3-python-3.yml
- name: Install Paramiko for Python 3 on Alpine command: apk add py3-paramiko
80
Python
.pyt
2
38
47
0.782051
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,506
uninstall-RedHat-9-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/uninstall-RedHat-9-python-3.yml
- name: Uninstall Paramiko for Python 3 on RHEL 9 pip: # no python3-paramiko package exists for RHEL 9 name: paramiko state: absent - name: Revert the crypto-policy back to DEFAULT command: update-crypto-policies --set DEFAULT
240
Python
.pyt
6
36.833333
54
0.759657
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,507
install-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/install-python-3.yml
- name: Install Paramiko for Python 3 package: name: python3-paramiko
76
Python
.pyt
3
22.333333
37
0.753425
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,508
uninstall-FreeBSD-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/uninstall-FreeBSD-python-3.yml
- name: Uninstall Paramiko for Python 3 on FreeBSD pip: name: paramiko state: absent
95
Python
.pyt
4
20.25
50
0.725275
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,509
install-FreeBSD-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/install-FreeBSD-python-3.yml
- name: Setup remote constraints include_tasks: setup-remote-constraints.yml - name: Install Paramiko for Python 3 on FreeBSD pip: # no package in pkg, just use pip name: paramiko extra_args: "-c {{ remote_constraints }}" environment: SETUPTOOLS_USE_DISTUTILS: stdlib
286
Python
.pyt
8
32.5
48
0.741007
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,510
install-RedHat-9-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/install-RedHat-9-python-3.yml
- name: Setup remote constraints include_tasks: setup-remote-constraints.yml - name: Install Paramiko for Python 3 on RHEL 9 pip: # no python3-paramiko package exists for RHEL 9 name: paramiko extra_args: "-c {{ remote_constraints }}" - name: Drop the crypto-policy to LEGACY for these tests command: upda...
352
Python
.pyt
8
41.125
56
0.755102
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,511
uninstall-apt-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/uninstall-apt-python-3.yml
- name: Uninstall Paramiko for Python 3 using apt apt: name: python3-paramiko state: absent autoremove: yes
122
Python
.pyt
5
20.6
49
0.726496
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,512
install-Darwin-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/install-Darwin-python-3.yml
- name: Setup remote constraints include_tasks: setup-remote-constraints.yml - name: Install Paramiko for Python 3 on MacOS pip: # no homebrew package manager in core, just use pip name: paramiko extra_args: "-c {{ remote_constraints }}" environment: # Not sure why this fixes the test, but it does. ...
355
Python
.pyt
9
36
58
0.736994
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,513
install-RedHat-8-python-3.yml
ansible_ansible/test/integration/targets/setup_paramiko/install-RedHat-8-python-3.yml
- name: Setup remote constraints include_tasks: setup-remote-constraints.yml - name: Install Paramiko for Python 3 on RHEL 8 pip: # no python3-paramiko package exists for RHEL 8 name: paramiko extra_args: "-c {{ remote_constraints }}" environment: SETUPTOOLS_USE_DISTUTILS: stdlib
299
Python
.pyt
8
34.125
54
0.749141
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,514
venv-pythons.py
ansible_ansible/test/integration/targets/ansible-test/venv-pythons.py
#!/usr/bin/env python """Return target Python options for use with ansible-test.""" from __future__ import annotations import argparse import os import shutil import subprocess import sys from ansible import release def main(): parser = argparse.ArgumentParser() parser.add_argument('--only-versions', action...
1,456
Python
.pyt
35
33.685714
103
0.632217
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,515
dataclasses.py
ansible_ansible/lib/ansible/galaxy/dependency_resolution/dataclasses.py
# -*- coding: utf-8 -*- # Copyright: (c) 2020-2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """Dependency structs.""" # FIXME: add caching all over the place from __future__ import annotations import os import typing as t from collections import na...
23,958
Python
.tac
517
35.491296
130
0.599571
ansible/ansible
62,258
23,791
861
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,516
setup.py
coursera-dl_coursera-dl/setup.py
# -*- coding: utf-8 -*- # # you can install this to a local test virtualenv like so: # virtualenv venv # ./venv/bin/pip install --editable . # ./venv/bin/pip install --editable .[dev] # with dev requirements, too from __future__ import print_function import os.path import subprocess import sys # For compatibil...
3,076
Python
.py
94
27.680851
89
0.658446
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,517
fabfile.py
coursera-dl_coursera-dl/fabfile.py
# # Fabric configuration - http://www.fabfile.org/ # from __future__ import print_function import errno import os from fabric.api import (env, local, task) MD2RST='pandoc --from=markdown --to=rst --output=README.rst README.md' if not os.path.exists('README.rst'): local(MD2RST) env.projname = local("python set...
1,954
Python
.py
67
25
72
0.657711
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,518
cookies.py
coursera-dl_coursera-dl/coursera/cookies.py
# -*- coding: utf-8 -*- """ Cookie handling module. """ import logging import os import ssl import requests from requests.adapters import HTTPAdapter try: # Workaround for broken Debian/Ubuntu packages? (See issue #331) from requests.packages.urllib3.poolmanager import PoolManager except ImportError: from ...
11,228
Python
.py
292
30.684932
79
0.64899
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,519
workflow.py
coursera-dl_coursera-dl/coursera/workflow.py
import os import re import abc import time import codecs import logging import subprocess import requests from .formatting import format_section, get_lecture_filename from .playlist import create_m3u_playlist from .utils import is_course_complete, mkdir_p, normalize_path from .filtering import find_resources_to_get, ...
9,473
Python
.py
211
32.322275
97
0.584617
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,520
credentials.py
coursera-dl_coursera-dl/coursera/credentials.py
# -*- coding: utf-8 -*- """ Manages the credential information (netrc, passwords, etc). """ import getpass import logging import netrc import os import platform try: import keyring except ImportError: keyring = None KEYRING_SERVICE_NAME = 'coursera-dl' class CredentialsError(BaseException): """ Cl...
5,022
Python
.py
124
33.580645
82
0.663442
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,521
downloaders.py
coursera-dl_coursera-dl/coursera/downloaders.py
# -*- coding: utf-8 -*- """ Module for download-related classes and functions. We currently support an internal downloader written in Python with just the essential functionality and four "industrial-strength" external downloaders, namely, aria2c, axel, curl, and wget. """ from __future__ import print_function impor...
12,143
Python
.py
316
28.892405
79
0.583369
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,522
network.py
coursera-dl_coursera-dl/coursera/network.py
""" This module contains utility functions that operate on the network, download some data and so on. """ import json import logging import requests def get_reply(session, url, post=False, data=None, headers=None, quiet=False): """ Download an HTML page using the requests session. Low-level function tha...
2,994
Python
.py
80
30.2
78
0.660083
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,523
extractors.py
coursera-dl_coursera-dl/coursera/extractors.py
""" This module contains implementation for extractors. Extractors know how to parse site of MOOC platform and return a list of modules to download. Usually they do not download heavy content, except when necessary to parse course syllabus. """ import abc import json import logging from .api import (CourseraOnDemand,...
9,215
Python
.py
193
31.07772
100
0.528409
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,524
formatting.py
coursera-dl_coursera-dl/coursera/formatting.py
import os from .define import FORMAT_MAX_LENGTH, TITLE_MAX_LENGTH def format_section(num, section, class_name, verbose_dirs): sec = '%02d_%s' % (num, section) if verbose_dirs: sec = class_name.upper() + '_' + sec return sec def format_resource(num, name, title, fmt): if title: title...
2,131
Python
.py
57
29.210526
74
0.617518
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,525
parallel.py
coursera-dl_coursera-dl/coursera/parallel.py
import abc import logging import traceback from multiprocessing.dummy import Pool class AbstractDownloader(object): """ Base class for download wrappers. Two methods should be implemented: `download` and `join`. """ __metaclass__ = abc.ABCMeta def __init__(self, file_downloader): supe...
2,039
Python
.py
55
30.163636
76
0.660071
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,526
api.py
coursera-dl_coursera-dl/coursera/api.py
# vim: set fileencoding=utf8 : """ This module contains implementations of different APIs that are used by the downloader. """ import os import re import json import base64 import logging import time import requests import urllib from collections import namedtuple, OrderedDict from six import iterkeys, iteritems from...
60,036
Python
.py
1,319
31.946171
142
0.548754
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,527
playlist.py
coursera-dl_coursera-dl/coursera/playlist.py
import os import glob def create_m3u_playlist(section_dir): """ Create M3U playlist with contents of `section_dir`/*.mp4. The playlist will be created in that directory. @param section_dir: Path where to scan for *.mp4 files. @type section_dir: str """ path_to_return = os.getcwd() fo...
733
Python
.py
20
28.95
74
0.60396
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,528
utils.py
coursera-dl_coursera-dl/coursera/utils.py
# -*- coding: utf-8 -*- """ This module provides utility functions that are used within the script. """ import os import re import sys import time import json import errno import random import string import logging import datetime from bs4 import BeautifulSoup as BeautifulSoup_ from xml.sax.saxutils import escape, ...
8,099
Python
.py
234
29.547009
140
0.654557
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,529
coursera_dl.py
coursera-dl_coursera-dl/coursera/coursera_dl.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Authors and copyright: # © 2012-2013, John Lehmann (first last at geemail dotcom or @jplehmann) # © 2012-2020, Rogério Theodoro de Brito # © 2013, Jonas De Taeye (first dt at fastmail fm) # # Contributions are welcome, but please add new unit tests to test yo...
9,648
Python
.py
233
34.669528
83
0.675112
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,530
commandline.py
coursera-dl_coursera-dl/coursera/commandline.py
""" This module contains code that is related to command-line argument handling. The primary candidate is argument parser. """ import os import sys import logging import configargparse as argparse from coursera import __version__ from .credentials import get_credentials, CredentialsError, keyring from .utils import ...
15,039
Python
.py
436
26.272936
79
0.607421
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,531
filtering.py
coursera-dl_coursera-dl/coursera/filtering.py
""" This module contains filtering functions. """ import re import logging from six import iteritems from six.moves.urllib_parse import urlparse # These formats are trusted and are not skipped VALID_FORMATS = r"""^mp4$| ^pdf$| ^.?.?\.?txt$| ^.?.?\.?srt$| ...
3,270
Python
.py
91
25.923077
109
0.544561
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,532
define.py
coursera-dl_coursera-dl/coursera/define.py
# -*- coding: utf-8 -*- """ This module defines the global constants. """ import os import getpass import tempfile HTTP_FORBIDDEN = 403 COURSERA_URL = 'https://api.coursera.org' AUTH_URL = 'https://accounts.coursera.org/api/v1/login' AUTH_URL_V3 = 'https://api.coursera.org/api/login/v3' CLASS_URL = 'https://class....
42,347
Python
.py
956
42.609833
1,345
0.522034
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,533
test_api.py
coursera-dl_coursera-dl/coursera/test/test_api.py
""" Test APIs. """ from os.path import expanduser import json import pytest from mock import patch, Mock from coursera import api from coursera import define from coursera.test.utils import slurp_fixture, links_to_plain_text from coursera.utils import BeautifulSoup from requests.exceptions import HTTPError from req...
25,872
Python
.py
583
36.391081
104
0.647353
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,534
test_commandline.py
coursera-dl_coursera-dl/coursera/test/test_commandline.py
""" Test command line module. """ from coursera import commandline from coursera.test import test_workflow def test_class_name_arg_required(): args = {'list_courses': False, 'version': False} mock_args = test_workflow.MockedCommandLineArgs(**args) assert commandline.class_name_arg_required(mock_args) d...
707
Python
.py
18
34.444444
65
0.697368
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,535
test_utils.py
coursera-dl_coursera-dl/coursera/test/test_utils.py
# -*- coding: utf-8 -*- """ Test the utility functions. """ import datetime import os import pytest import random import json from time import time import requests import six from mock import Mock from coursera import utils from coursera import coursera_dl from coursera import api from coursera.test.utils import sl...
7,584
Python
.py
179
36.26257
92
0.660766
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,536
test_credentials.py
coursera-dl_coursera-dl/coursera/test/test_credentials.py
# -*- coding: utf-8 -*- """ Test retrieving the credentials. """ import os.path import pytest from coursera import credentials NETRC = \ os.path.join(os.path.dirname(__file__), "fixtures", "auth", "netrc") NOT_NETRC = \ os.path.join(os.path.dirname(__file__), "fixtures",...
2,302
Python
.py
58
31.810345
77
0.664112
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,537
utils.py
coursera-dl_coursera-dl/coursera/test/utils.py
""" Helper functions that are only used in tests. """ import os import re from io import open from six import iteritems from coursera.define import IN_MEMORY_MARKER from coursera.utils import BeautifulSoup def slurp_fixture(path): return open(os.path.join(os.path.dirname(__file__), ...
1,315
Python
.py
33
33.030303
89
0.66011
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,538
test_cookies.py
coursera-dl_coursera-dl/coursera/test/test_cookies.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test syllabus parsing. """ import os.path import requests from six.moves import http_cookiejar as cookielib from coursera import cookies FIREFOX_COOKIES = \ os.path.join(os.path.dirname(__file__), "fixtures", "cookies", "firefox_cookies.txt") C...
2,861
Python
.py
72
34.375
79
0.696838
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,539
test_filter.py
coursera-dl_coursera-dl/coursera/test/test_filter.py
from coursera.filtering import skip_format_url def test_filter(): test_cases = [ (True, 'ipynb', 'http://localhost:8888/notebooks/machine-learning-specialization-private/course-4/2_kmeans-with-text-data_sklearn.ipynb#Takeaway'), (True, '', 'http://developer.android.com/reference/android/location/L...
2,229
Python
.py
25
81.12
372
0.707727
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,540
test_downloaders.py
coursera-dl_coursera-dl/coursera/test/test_downloaders.py
# -*- coding: utf-8 -*- """ Test the downloaders. """ from coursera import downloaders from coursera import coursera_dl from coursera.filtering import find_resources_to_get import pytest @pytest.fixture def sample_bag(): sample_bag = { 'mp4': [['h://url1/lc1.mp4', 'video']], 'pdf': [['h://url2/...
6,824
Python
.py
175
33.354286
71
0.624562
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,541
test_parsing.py
coursera-dl_coursera-dl/coursera/test/test_parsing.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test functionality of coursera module. """ import json import os.path import pytest from six import iteritems from mock import patch, Mock, mock_open from coursera import coursera_dl from coursera import api from coursera.define import IN_MEMORY_EXTENSION, IN_MEMORY...
4,888
Python
.py
109
38.908257
89
0.654357
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,542
test_workflow.py
coursera-dl_coursera-dl/coursera/test/test_workflow.py
from os.path import normpath import pytest import requests from requests.exceptions import RequestException from coursera.workflow import CourseraDownloader, _iter_modules, _walk_modules from coursera.commandline import parse_args from coursera.parallel import ConsecutiveDownloader, ParallelDownloader from coursera.do...
5,460
Python
.py
131
32.587786
95
0.630537
coursera-dl/coursera-dl
9,343
2,207
211
LGPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,543
tasks.py
jrnl-org_jrnl/tasks.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import json import os import pathlib import subprocess import requests import xmltodict DOCS_URL = "http://127.0.0.1:8000" SITEMAP_FILENAME = "sitemap.xml" CONFIG_FILENAME = "config.json" def delete_files(files): fo...
1,412
Python
.py
45
25
83
0.616012
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,544
conftest.py
jrnl-org_jrnl/tests/conftest.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from pytest import mark from pytest import skip from jrnl.os_compat import on_posix from jrnl.os_compat import on_windows pytest_plugins = [ "tests.lib.fixtures", "tests.lib.given_steps", "tests.lib.when_steps...
1,463
Python
.py
40
31.225
81
0.660752
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,545
test_os_compat.py
jrnl-org_jrnl/tests/unit/test_os_compat.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from unittest import mock import pytest from jrnl.os_compat import on_posix from jrnl.os_compat import on_windows from jrnl.os_compat import split_args @pytest.mark.parametrize( "systems", [ ["linux", Fa...
2,418
Python
.py
80
23.7875
75
0.568543
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,546
test_override.py
jrnl-org_jrnl/tests/unit/test_override.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from argparse import Namespace import pytest from jrnl.override import _convert_dots_to_list from jrnl.override import _get_config_node from jrnl.override import _get_key_and_value_from_pair from jrnl.override import _rec...
3,191
Python
.py
88
30
72
0.612987
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,547
test_controller.py
jrnl-org_jrnl/tests/unit/test_controller.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import random import string from unittest import mock import pytest import jrnl from jrnl.args import parse_args from jrnl.controller import _display_search_results @pytest.fixture def random_string(): return "".joi...
1,595
Python
.py
38
38.526316
80
0.745455
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,548
test_install.py
jrnl-org_jrnl/tests/unit/test_install.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import sys from unittest import mock import pytest @pytest.mark.filterwarnings( "ignore:.*imp module is deprecated.*" ) # ansiwrap spits out an unrelated warning def test_initialize_autocomplete_runs_without_readlin...
487
Python
.py
12
37.5
72
0.765957
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,549
test_color.py
jrnl-org_jrnl/tests/unit/test_color.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import pytest from colorama import Fore from colorama import Style from jrnl.color import colorize @pytest.fixture() def data_fixture(): string = "Zwei peanuts walked into a bar" yield string def test_colorize(...
499
Python
.py
14
32.714286
82
0.761506
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,550
test_output.py
jrnl-org_jrnl/tests/unit/test_output.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from unittest.mock import Mock from unittest.mock import patch from jrnl.messages import Message from jrnl.output import print_msg @patch("jrnl.output.print_msgs") def test_print_msg_calls_print_msgs_as_list_with_style(p...
853
Python
.py
22
34.590909
82
0.706667
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,551
test_time.py
jrnl-org_jrnl/tests/unit/test_time.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import datetime import pytest from jrnl import time def test_default_hour_is_added(): assert time.parse( "2020-06-20", inclusive=False, default_hour=9, default_minute=0, bracketed=False ) == datetime.dat...
1,071
Python
.py
35
24.657143
88
0.601753
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,552
test_config_file.py
jrnl-org_jrnl/tests/unit/test_config_file.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import os import pytest from jrnl.exception import JrnlException from jrnl.install import find_alt_config def test_find_alt_config(request): work_config_path = os.path.join( request.fspath.dirname, "..", "da...
832
Python
.py
20
37.05
78
0.718012
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,553
test_journals_folder_journal.py
jrnl-org_jrnl/tests/unit/test_journals_folder_journal.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import pathlib from unittest import mock import pytest from jrnl.journals.FolderJournal import Folder @pytest.mark.parametrize( "inputs_and_outputs", [ [ "/2020/01", ["02.txt", "0...
1,731
Python
.py
49
26.612245
84
0.541268
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,554
test_parse_args.py
jrnl-org_jrnl/tests/unit/test_parse_args.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import shlex import pytest from jrnl.args import parse_args from jrnl.config import make_yaml_valid_dict def cli_as_dict(str): cli = shlex.split(str) args = parse_args(cli) return vars(args) def expected_a...
8,654
Python
.py
219
33.643836
88
0.63729
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,555
test_editor.py
jrnl-org_jrnl/tests/unit/test_editor.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import os from unittest.mock import mock_open from unittest.mock import patch import pytest from jrnl.editor import get_template_path from jrnl.editor import read_template_file from jrnl.exception import JrnlEx...
1,629
Python
.py
32
46.09375
88
0.742202
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,556
test_export.py
jrnl-org_jrnl/tests/unit/test_export.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from unittest import mock import pytest from jrnl.exception import JrnlException from jrnl.plugins.fancy_exporter import check_provided_linewrap_viability from jrnl.plugins.yaml_exporter import YAMLExporter @pytest.fixtu...
1,057
Python
.py
27
33.703704
81
0.729703
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,557
test_path.py
jrnl-org_jrnl/tests/unit/test_path.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import random import string from os import getenv from unittest.mock import patch import pytest from jrnl.path import absolute_path from jrnl.path import expand_path from jrnl.path import home_dir @pytest.fixture def ho...
2,967
Python
.py
82
32.695122
81
0.709193
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,558
fixtures.py
jrnl-org_jrnl/tests/lib/fixtures.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import os import tempfile from collections import defaultdict from collections.abc import Iterable from pathlib import Path from unittest.mock import Mock from unittest.mock import patch import toml from keyring import bac...
8,540
Python
.py
256
27.652344
83
0.673554
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,559
type_builders.py
jrnl-org_jrnl/tests/lib/type_builders.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from parse_type import TypeBuilder should_choice = TypeBuilder.make_enum( { "should": True, "should not": False, } )
239
Python
.py
9
22.666667
52
0.688596
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,560
when_steps.py
jrnl-org_jrnl/tests/lib/when_steps.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import os from contextlib import ExitStack from pytest_bdd import when from pytest_bdd.parsers import parse from pytest_bdd.parsers import re # This is an undocumented and unsupported function: # https://github.com/pytest...
2,247
Python
.py
52
38.461538
80
0.690717
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,561
given_steps.py
jrnl-org_jrnl/tests/lib/given_steps.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import json import os import random import shutil import string from datetime import datetime from unittest.mock import MagicMock from unittest.mock import patch from xml.etree import ElementTree as ET from pytest_bdd impo...
6,574
Python
.py
140
42.014286
88
0.704538
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,562
helpers.py
jrnl-org_jrnl/tests/lib/helpers.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import functools import os def does_directory_contain_files(file_list, directory_path): if not os.path.isdir(directory_path): return False for file in file_list.split("\n"): fullpath = directory_p...
1,921
Python
.py
56
28.375
85
0.660705
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,563
then_steps.py
jrnl-org_jrnl/tests/lib/then_steps.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import json import os import re from xml.etree import ElementTree as ET from pytest_bdd import then from pytest_bdd.parsers import parse from ruamel.yaml import YAML from jrnl.config import scope_config from tests.lib.hel...
14,565
Python
.py
333
37.666667
88
0.666195
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,564
test_features.py
jrnl-org_jrnl/tests/bdd/test_features.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from pytest_bdd import scenarios scenarios("features/actions.feature") scenarios("features/build.feature") scenarios("features/config_file.feature") scenarios("features/core.feature") scenarios("features/datetime.feature")...
938
Python
.py
24
38
52
0.828947
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,565
allow_all_python_version.py
jrnl-org_jrnl/.build/allow_all_python_version.py
import toml pyproject = toml.load("pyproject.toml") pyproject["tool"]["poetry"]["dependencies"]["python"] = "*" with open("pyproject.toml", "w") as toml_file: toml.dump(pyproject, toml_file)
198
Python
.py
5
37.2
59
0.705263
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,566
__main__.py
jrnl-org_jrnl/jrnl/__main__.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import sys from jrnl.main import run if __name__ == "__main__": sys.exit(run())
183
Python
.py
6
28.333333
52
0.701149
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,567
path.py
jrnl-org_jrnl/jrnl/path.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import os.path from pathlib import Path import xdg.BaseDirectory from jrnl.exception import JrnlException from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText # Constants...
2,066
Python
.py
54
31.888889
84
0.685557
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,568
config.py
jrnl-org_jrnl/jrnl/config.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import argparse import logging import os from typing import Any from typing import Callable import colorama from rich.pretty import pretty_repr from ruamel.yaml import YAML from ruamel.yaml import constructor from jrnl im...
7,057
Python
.py
186
30
88
0.623169
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,569
exception.py
jrnl-org_jrnl/jrnl/exception.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from typing import TYPE_CHECKING from jrnl.output import print_msg if TYPE_CHECKING: from jrnl.messages import Message from jrnl.messages import MsgText class JrnlException(Exception): """Common exceptions r...
635
Python
.py
16
34.4375
67
0.703764
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,570
prompt.py
jrnl-org_jrnl/jrnl/prompt.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText from jrnl.output import print_msg from jrnl.output import print_msgs def create_password(journal_name: str) -> str: ...
2,086
Python
.py
64
23.90625
79
0.610169
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,571
os_compat.py
jrnl-org_jrnl/jrnl/os_compat.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import shlex from sys import platform def on_windows() -> bool: return "win32" in platform def on_posix() -> bool: return not on_windows() def split_args(args: str) -> list[str]: """Split arguments and add...
415
Python
.py
11
34.636364
77
0.725441
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,572
controller.py
jrnl-org_jrnl/jrnl/controller.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import logging import sys from typing import TYPE_CHECKING from jrnl import install from jrnl import plugins from jrnl import time from jrnl.config import DEFAULT_JOURNAL_KEY from jrnl.config import get_config_path from jr...
13,799
Python
.py
360
31.3
88
0.656325
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,573
output.py
jrnl-org_jrnl/jrnl/output.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import textwrap from typing import Callable from rich.console import Console from rich.text import Text from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText def deprecat...
3,768
Python
.py
100
32.06
77
0.665747
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,574
upgrade.py
jrnl-org_jrnl/jrnl/upgrade.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import logging import os from jrnl import __version__ from jrnl.config import is_config_json from jrnl.config import load_config from jrnl.config import scope_config from jrnl.exception import JrnlException from jrnl.journ...
6,164
Python
.py
172
26.465116
88
0.600806
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,575
time.py
jrnl-org_jrnl/jrnl/time.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import datetime FAKE_YEAR = 9999 DEFAULT_FUTURE = datetime.datetime(FAKE_YEAR, 12, 31, 23, 59, 59) DEFAULT_PAST = datetime.datetime(FAKE_YEAR, 1, 1, 0, 0) def __get_pdt_calendar(): import parsedatetime as pdt co...
3,395
Python
.py
85
31.435294
88
0.620595
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,576
__init__.py
jrnl-org_jrnl/jrnl/__init__.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html try: from jrnl.__version__ import __version__ except ImportError: __version__ = "source" __title__ = "jrnl"
213
Python
.py
7
28.142857
52
0.692683
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,577
editor.py
jrnl-org_jrnl/jrnl/editor.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import logging import os import subprocess import sys import tempfile from pathlib import Path from jrnl.exception import JrnlException from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.message...
3,593
Python
.py
99
28.080808
88
0.635945
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,578
color.py
jrnl-org_jrnl/jrnl/color.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import re from string import punctuation from string import whitespace from typing import TYPE_CHECKING import colorama from jrnl.os_compat import on_windows if TYPE_CHECKING: from jrnl.journals import Entry if on_w...
3,227
Python
.py
70
38.171429
87
0.660623
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,579
args.py
jrnl-org_jrnl/jrnl/args.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import argparse import re import textwrap from jrnl.commands import postconfig_decrypt from jrnl.commands import postconfig_encrypt from jrnl.commands import postconfig_import from jrnl.commands import postconfig_list from...
13,964
Python
.py
412
26.410194
112
0.61756
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,580
override.py
jrnl-org_jrnl/jrnl/override.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from typing import TYPE_CHECKING from jrnl.config import make_yaml_valid_dict from jrnl.config import update_config if TYPE_CHECKING: from argparse import Namespace # import logging def apply_overrides(args: "Namesp...
2,469
Python
.py
60
35.366667
87
0.690795
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,581
main.py
jrnl-org_jrnl/jrnl/main.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import logging import sys import traceback from rich.logging import RichHandler from jrnl import controller from jrnl.args import parse_args from jrnl.exception import JrnlException from jrnl.messages import Message from ...
2,263
Python
.py
70
23.985714
64
0.615632
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,582
keyring.py
jrnl-org_jrnl/jrnl/keyring.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import keyring from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText from jrnl.output import print_msg def get_keyring_password(journal_name: str = "default") -> str | Non...
1,045
Python
.py
23
39.478261
79
0.728346
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,583
install.py
jrnl-org_jrnl/jrnl/install.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import contextlib import glob import logging import os import sys from rich.pretty import pretty_repr from jrnl import __version__ from jrnl.config import DEFAULT_JOURNAL_KEY from jrnl.config import get_config_path from j...
5,849
Python
.py
148
32.472973
86
0.675785
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,584
commands.py
jrnl-org_jrnl/jrnl/commands.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html """ Functions in this file are standalone commands. All standalone commands are split into two categories depending on whether they require the config to be loaded to be able to run. 1. "preconfig" commands don't require th...
4,936
Python
.py
130
31.784615
87
0.687106
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,585
Entry.py
jrnl-org_jrnl/jrnl/journals/Entry.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import datetime import logging import os import re from typing import TYPE_CHECKING from jrnl.color import colorize from jrnl.color import highlight_tags_with_background_color from jrnl.output import wrap_with_ansi_colors ...
7,338
Python
.py
197
27.040609
109
0.540312
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,586
FolderJournal.py
jrnl-org_jrnl/jrnl/journals/FolderJournal.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import codecs import os import pathlib from typing import TYPE_CHECKING from jrnl import time from .Journal import Journal if TYPE_CHECKING: from jrnl.journals import Entry # glob search patterns for folder/file str...
5,719
Python
.py
133
32.12782
88
0.579572
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,587
Journal.py
jrnl-org_jrnl/jrnl/journals/Journal.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import datetime import logging import os import re from jrnl import time from jrnl.config import validate_journal_name from jrnl.encryption import determine_encryption_method from jrnl.messages import Message from jrnl.mes...
18,836
Python
.py
438
31.860731
88
0.572224
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,588
__init__.py
jrnl-org_jrnl/jrnl/journals/__init__.py
from .DayOneJournal import DayOne from .Entry import Entry from .FolderJournal import Folder from .Journal import Journal from .Journal import open_journal
156
Python
.py
5
30.2
33
0.860927
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,589
DayOneJournal.py
jrnl-org_jrnl/jrnl/journals/DayOneJournal.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import contextlib import datetime import fnmatch import os import platform import plistlib import re import socket import time import uuid import zoneinfo from pathlib import Path from xml.parsers.expat import ExpatError i...
8,969
Python
.py
191
31.570681
88
0.517143
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,590
MsgStyle.py
jrnl-org_jrnl/jrnl/messages/MsgStyle.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from enum import Enum from typing import Callable from typing import NamedTuple from rich import box from rich.panel import Panel from jrnl.messages.MsgText import MsgText class MsgStyle(Enum): class _Color(NamedTup...
2,253
Python
.py
78
21.076923
71
0.55787
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,591
MsgText.py
jrnl-org_jrnl/jrnl/messages/MsgText.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from enum import Enum class MsgText(Enum): def __str__(self) -> str: return self.value # -- Welcome --- # WelcomeToJrnl = """ Welcome to jrnl {version}! It looks like you've been usin...
9,246
Python
.py
215
35.590698
93
0.655692
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,592
Message.py
jrnl-org_jrnl/jrnl/messages/Message.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from typing import TYPE_CHECKING from typing import Mapping from typing import NamedTuple from jrnl.messages.MsgStyle import MsgStyle if TYPE_CHECKING: from jrnl.messages.MsgText import MsgText class Message(NamedTu...
409
Python
.py
12
31.333333
52
0.790816
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,593
__init__.py
jrnl-org_jrnl/jrnl/messages/__init__.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText Message = Message.Message MsgStyle = MsgStyle.MsgStyle MsgText = MsgText.MsgText
282
Python
.py
8
34
52
0.830882
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,594
util.py
jrnl-org_jrnl/jrnl/plugins/util.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html from collections import Counter from typing import TYPE_CHECKING if TYPE_CHECKING: from jrnl.journals import Journal class NestedDict(dict): """https://stackoverflow.com/a/74873621/8740440""" def __missing__...
2,144
Python
.py
49
37.979592
88
0.661221
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,595
markdown_exporter.py
jrnl-org_jrnl/jrnl/plugins/markdown_exporter.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import os import re from typing import TYPE_CHECKING from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText from jrnl.output import print_msg from jrnl.plugins.text_exporter ...
3,309
Python
.py
83
28.975904
76
0.539683
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,596
fancy_exporter.py
jrnl-org_jrnl/jrnl/plugins/fancy_exporter.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import logging import os from textwrap import TextWrapper from typing import TYPE_CHECKING from jrnl.exception import JrnlException from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages imp...
3,977
Python
.py
106
26.971698
87
0.559185
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,597
text_exporter.py
jrnl-org_jrnl/jrnl/plugins/text_exporter.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import errno import os import re import unicodedata from typing import TYPE_CHECKING from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText from jrnl.output import print_msg ...
3,844
Python
.py
96
29.364583
83
0.572423
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,598
jrnl_importer.py
jrnl-org_jrnl/jrnl/plugins/jrnl_importer.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import sys from typing import TYPE_CHECKING from jrnl.exception import JrnlException from jrnl.messages import Message from jrnl.messages import MsgStyle from jrnl.messages import MsgText from jrnl.output import print_msg ...
1,549
Python
.py
43
26.27907
86
0.599466
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)
14,599
json_exporter.py
jrnl-org_jrnl/jrnl/plugins/json_exporter.py
# Copyright © 2012-2023 jrnl contributors # License: https://www.gnu.org/licenses/gpl-3.0.html import json from typing import TYPE_CHECKING from jrnl.plugins.text_exporter import TextExporter from jrnl.plugins.util import get_tags_count if TYPE_CHECKING: from jrnl.journals import Entry from jrnl.journals im...
2,566
Python
.py
59
33.779661
86
0.599119
jrnl-org/jrnl
6,434
519
140
GPL-3.0
9/5/2024, 5:11:58 PM (Europe/Amsterdam)