Giter Club home page Giter Club logo

Comments (5)

lipoja avatar lipoja commented on May 26, 2024

Hi,
thank you for describing this use case. I agree with you in some points. For example my use case was to have always up to date list of TLDs. That is why I wanted to download the file and not keeping it in repository.

But I think It is good idea, especially for the testing purposes. I will think about it and do it in some way.

from urlextract.

impredicative avatar impredicative commented on May 26, 2024

I think it's saner for the package to include in it a copy of the file. If the file is very large, it can be stored compressed. It's not a bad idea to just update the package on PyPI every once in a while with the new file.

from urlextract.

impredicative avatar impredicative commented on May 26, 2024

Think about the use of the package in a serverless setting where instances can be torn down and recreated on demand from scratch. We wouldn't want the file to be downloaded over and over again for no reason, would be. Similarly, think of build bots that rebuild after each commit.

from urlextract.

lipoja avatar lipoja commented on May 26, 2024

Thanks for the suggestion, I've added list of TLDs to the package.

from urlextract.

LaundroMat avatar LaundroMat commented on May 26, 2024

It's late, so my apologies if I'm overlooking something, but would it be an idea to add a parameter to URLExtract() to make it so it does not need a writeable cache directory?

I'm using URLExtract in an AWS Lambda function and I'm pointing URLExtract to the cache directory:

URLExtract(cache_dir=Path(f'{os.getenv("LAMBDA_TASK_ROOT")}/urlextract/data'))

which generates an error:

CacheFileError: Cache directory /var/task/urlextract/data is not writable.

The error is caused by

if not os.access(self._user_defined_cache_dir, os.W_OK):

Update 1: I'll try and solve it by copying the data to a writeable /tmp directory
Update 2: I could use /tmp as my user-defined cache directory and have URLExtract download the list there, but as @lipoya mentioned earlier, that could imply overloading the servers from where the list is downloaded.

from urlextract.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.