including folder and files inside a Python packageHow to read a (static) file from inside a Python package?How include static files to setuptools - python packageHow can I represent an 'Enum' in Python?What is the Python 3 equivalent of “python -m SimpleHTTPServer”Python package installation issuespython implicit namespace packages are not installing with setuptoolsWhy is “1000000000000000 in range(1000000000000001)” so fast in Python 3?creating a pip package to allow others to to download - problems installing the created packagePython Packaging - NameErrorNested Python Packages/Django Application PackagingHow can I include the parent folder structure on a library distribution in Python 3.6 using setuptools?Python: Multiple packages in one repository or one package per repository?

Why is gun control associated with the socially liberal Democratic party?

In The Incredibles 2, why does Screenslaver's name use a pun on something that doesn't exist in the 1950s pastiche?

Can an open source licence be revoked if it violates employer's IP?

Optimising matrix generation time

Does an African-American baby born in Youngstown, Ohio have a higher infant mortality rate than a baby born in Iran?

Are athletes' college degrees discounted by employers and graduate school admissions?

Has JSON.serialize suppressApexObjectNulls ever worked?

Should I move out from my current apartment before the contract ends to save more money?

How can I find out about the game world without meta-influencing it?

I sent an angry e-mail to my interviewers about a conflict at my home institution. Could this affect my application?

Why did the Death Eaters wait to reopen the Chamber of Secrets?

Would a character with eternal youth be AL-compliant?

Is pointing finger in meeting consider bad?

Parsing text written the millitext font

What are the advantages of using TLRs to rangefinders?

Is fission/fusion to iron the most efficient way to convert mass to energy?

Is it true that "only photographers care about noise"?

Why is C++ template use not recommended in space/radiated environment?

Certain list transform

I received a gift from my sister who just got back from

Is there a term for someone whose preferred policies are a mix of Left and Right?

How can this shape perfectly cover a cube?

Manager wants to hire me; HR does not. How to proceed?

What is the theme of analysis?



including folder and files inside a Python package


How to read a (static) file from inside a Python package?How include static files to setuptools - python packageHow can I represent an 'Enum' in Python?What is the Python 3 equivalent of “python -m SimpleHTTPServer”Python package installation issuespython implicit namespace packages are not installing with setuptoolsWhy is “1000000000000000 in range(1000000000000001)” so fast in Python 3?creating a pip package to allow others to to download - problems installing the created packagePython Packaging - NameErrorNested Python Packages/Django Application PackagingHow can I include the parent folder structure on a library distribution in Python 3.6 using setuptools?Python: Multiple packages in one repository or one package per repository?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








2















I'm trying to make a python package and I have most of the things already setup by when I try to install the library from Github here, it installs everything except for the folder called champs and it's files



This is my File directory structure



LeagueYue
champs
-Lname_num.json
-Lname_Uname.json
-num_Uname.json
-__init__.py
-champion_files.py
-external.py
-match.py
-rank.py
-status.py
-summoner.py
-requirements.txt
-setup.py


All the files are installed except for the folder and the files inside champs










share|improve this question



















  • 1





    I believe this question can solve your problem.

    – Augusto A
    Mar 27 at 2:23











  • Thank you, it worked amazingly! As for the bounty, I think you will have to post it as an "answer "and not a comment even though it is the answer.

    – KowaiiNeko
    Mar 27 at 2:45


















2















I'm trying to make a python package and I have most of the things already setup by when I try to install the library from Github here, it installs everything except for the folder called champs and it's files



This is my File directory structure



LeagueYue
champs
-Lname_num.json
-Lname_Uname.json
-num_Uname.json
-__init__.py
-champion_files.py
-external.py
-match.py
-rank.py
-status.py
-summoner.py
-requirements.txt
-setup.py


All the files are installed except for the folder and the files inside champs










share|improve this question



















  • 1





    I believe this question can solve your problem.

    – Augusto A
    Mar 27 at 2:23











  • Thank you, it worked amazingly! As for the bounty, I think you will have to post it as an "answer "and not a comment even though it is the answer.

    – KowaiiNeko
    Mar 27 at 2:45














2












2








2


1






I'm trying to make a python package and I have most of the things already setup by when I try to install the library from Github here, it installs everything except for the folder called champs and it's files



This is my File directory structure



LeagueYue
champs
-Lname_num.json
-Lname_Uname.json
-num_Uname.json
-__init__.py
-champion_files.py
-external.py
-match.py
-rank.py
-status.py
-summoner.py
-requirements.txt
-setup.py


All the files are installed except for the folder and the files inside champs










share|improve this question
















I'm trying to make a python package and I have most of the things already setup by when I try to install the library from Github here, it installs everything except for the folder called champs and it's files



This is my File directory structure



LeagueYue
champs
-Lname_num.json
-Lname_Uname.json
-num_Uname.json
-__init__.py
-champion_files.py
-external.py
-match.py
-rank.py
-status.py
-summoner.py
-requirements.txt
-setup.py


All the files are installed except for the folder and the files inside champs







python-3.x python-packaging






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 1:40







KowaiiNeko

















asked Mar 25 at 1:34









KowaiiNekoKowaiiNeko

13110




13110







  • 1





    I believe this question can solve your problem.

    – Augusto A
    Mar 27 at 2:23











  • Thank you, it worked amazingly! As for the bounty, I think you will have to post it as an "answer "and not a comment even though it is the answer.

    – KowaiiNeko
    Mar 27 at 2:45













  • 1





    I believe this question can solve your problem.

    – Augusto A
    Mar 27 at 2:23











  • Thank you, it worked amazingly! As for the bounty, I think you will have to post it as an "answer "and not a comment even though it is the answer.

    – KowaiiNeko
    Mar 27 at 2:45








1




1





I believe this question can solve your problem.

– Augusto A
Mar 27 at 2:23





I believe this question can solve your problem.

– Augusto A
Mar 27 at 2:23













Thank you, it worked amazingly! As for the bounty, I think you will have to post it as an "answer "and not a comment even though it is the answer.

– KowaiiNeko
Mar 27 at 2:45






Thank you, it worked amazingly! As for the bounty, I think you will have to post it as an "answer "and not a comment even though it is the answer.

– KowaiiNeko
Mar 27 at 2:45













2 Answers
2






active

oldest

votes


















2





+150









As this question answers:



There are 2 ways to add the static files:



1) Include_package_data=True + MANIFEST.in



A MANIFEST.in file in the same directory of setup.py, that looks like this:



include src/static/*
include src/Potato/*.txt


2) Package_data in setup.py



package_data = 
'static': ['*'],
'Potato': ['*.txt']



Specify the files inside the setup.py.






share|improve this answer






























    1














    Two of the files could probably be derived at runtime from num_Uname.json, but that's fine.



    I do not yet see a data_files directive in https://github.com/CharmingMother/LeagueLib/blob/async/setup.py



    Thomas Cokelaer suggests using an expression like



    datafiles = [(datadir, list(glob.glob(os.path.join(datadir, '*'))))]


    and then



    setup(
    ...
        data_files = datafiles,
    )


    in http://thomas-cokelaer.info/blog/2012/03/how-to-embedded-data-files-in-python-using-setuptools/



    In your case this could be as simple as:



    data_files = [('', ['champs/num_Uname.json'])],


    Martin Thoma explains you should access them using filepath = pkg_resources.resource_filename(__name__, path)
    in How to read a (static) file from inside a Python package?



    When I Read The Fine Manual, this setup.cfg alternative surfaces:



    [options.data_files]
    ...
    data = data/img/logo.png, data/svg/icon.svg


    suggesting a line like . = champs/num_Uname.json or champs = num_Uname.json






    share|improve this answer

























    • Thank you for your answer and insight, I wish I could also give you a bounty reward as well but Augusto A has already answered before you

      – KowaiiNeko
      Mar 27 at 3:55












    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330280%2fincluding-folder-and-files-inside-a-python-package%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2





    +150









    As this question answers:



    There are 2 ways to add the static files:



    1) Include_package_data=True + MANIFEST.in



    A MANIFEST.in file in the same directory of setup.py, that looks like this:



    include src/static/*
    include src/Potato/*.txt


    2) Package_data in setup.py



    package_data = 
    'static': ['*'],
    'Potato': ['*.txt']



    Specify the files inside the setup.py.






    share|improve this answer



























      2





      +150









      As this question answers:



      There are 2 ways to add the static files:



      1) Include_package_data=True + MANIFEST.in



      A MANIFEST.in file in the same directory of setup.py, that looks like this:



      include src/static/*
      include src/Potato/*.txt


      2) Package_data in setup.py



      package_data = 
      'static': ['*'],
      'Potato': ['*.txt']



      Specify the files inside the setup.py.






      share|improve this answer

























        2





        +150







        2





        +150



        2




        +150





        As this question answers:



        There are 2 ways to add the static files:



        1) Include_package_data=True + MANIFEST.in



        A MANIFEST.in file in the same directory of setup.py, that looks like this:



        include src/static/*
        include src/Potato/*.txt


        2) Package_data in setup.py



        package_data = 
        'static': ['*'],
        'Potato': ['*.txt']



        Specify the files inside the setup.py.






        share|improve this answer













        As this question answers:



        There are 2 ways to add the static files:



        1) Include_package_data=True + MANIFEST.in



        A MANIFEST.in file in the same directory of setup.py, that looks like this:



        include src/static/*
        include src/Potato/*.txt


        2) Package_data in setup.py



        package_data = 
        'static': ['*'],
        'Potato': ['*.txt']



        Specify the files inside the setup.py.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 27 at 2:57









        Augusto AAugusto A

        1861




        1861























            1














            Two of the files could probably be derived at runtime from num_Uname.json, but that's fine.



            I do not yet see a data_files directive in https://github.com/CharmingMother/LeagueLib/blob/async/setup.py



            Thomas Cokelaer suggests using an expression like



            datafiles = [(datadir, list(glob.glob(os.path.join(datadir, '*'))))]


            and then



            setup(
            ...
                data_files = datafiles,
            )


            in http://thomas-cokelaer.info/blog/2012/03/how-to-embedded-data-files-in-python-using-setuptools/



            In your case this could be as simple as:



            data_files = [('', ['champs/num_Uname.json'])],


            Martin Thoma explains you should access them using filepath = pkg_resources.resource_filename(__name__, path)
            in How to read a (static) file from inside a Python package?



            When I Read The Fine Manual, this setup.cfg alternative surfaces:



            [options.data_files]
            ...
            data = data/img/logo.png, data/svg/icon.svg


            suggesting a line like . = champs/num_Uname.json or champs = num_Uname.json






            share|improve this answer

























            • Thank you for your answer and insight, I wish I could also give you a bounty reward as well but Augusto A has already answered before you

              – KowaiiNeko
              Mar 27 at 3:55
















            1














            Two of the files could probably be derived at runtime from num_Uname.json, but that's fine.



            I do not yet see a data_files directive in https://github.com/CharmingMother/LeagueLib/blob/async/setup.py



            Thomas Cokelaer suggests using an expression like



            datafiles = [(datadir, list(glob.glob(os.path.join(datadir, '*'))))]


            and then



            setup(
            ...
                data_files = datafiles,
            )


            in http://thomas-cokelaer.info/blog/2012/03/how-to-embedded-data-files-in-python-using-setuptools/



            In your case this could be as simple as:



            data_files = [('', ['champs/num_Uname.json'])],


            Martin Thoma explains you should access them using filepath = pkg_resources.resource_filename(__name__, path)
            in How to read a (static) file from inside a Python package?



            When I Read The Fine Manual, this setup.cfg alternative surfaces:



            [options.data_files]
            ...
            data = data/img/logo.png, data/svg/icon.svg


            suggesting a line like . = champs/num_Uname.json or champs = num_Uname.json






            share|improve this answer

























            • Thank you for your answer and insight, I wish I could also give you a bounty reward as well but Augusto A has already answered before you

              – KowaiiNeko
              Mar 27 at 3:55














            1












            1








            1







            Two of the files could probably be derived at runtime from num_Uname.json, but that's fine.



            I do not yet see a data_files directive in https://github.com/CharmingMother/LeagueLib/blob/async/setup.py



            Thomas Cokelaer suggests using an expression like



            datafiles = [(datadir, list(glob.glob(os.path.join(datadir, '*'))))]


            and then



            setup(
            ...
                data_files = datafiles,
            )


            in http://thomas-cokelaer.info/blog/2012/03/how-to-embedded-data-files-in-python-using-setuptools/



            In your case this could be as simple as:



            data_files = [('', ['champs/num_Uname.json'])],


            Martin Thoma explains you should access them using filepath = pkg_resources.resource_filename(__name__, path)
            in How to read a (static) file from inside a Python package?



            When I Read The Fine Manual, this setup.cfg alternative surfaces:



            [options.data_files]
            ...
            data = data/img/logo.png, data/svg/icon.svg


            suggesting a line like . = champs/num_Uname.json or champs = num_Uname.json






            share|improve this answer















            Two of the files could probably be derived at runtime from num_Uname.json, but that's fine.



            I do not yet see a data_files directive in https://github.com/CharmingMother/LeagueLib/blob/async/setup.py



            Thomas Cokelaer suggests using an expression like



            datafiles = [(datadir, list(glob.glob(os.path.join(datadir, '*'))))]


            and then



            setup(
            ...
                data_files = datafiles,
            )


            in http://thomas-cokelaer.info/blog/2012/03/how-to-embedded-data-files-in-python-using-setuptools/



            In your case this could be as simple as:



            data_files = [('', ['champs/num_Uname.json'])],


            Martin Thoma explains you should access them using filepath = pkg_resources.resource_filename(__name__, path)
            in How to read a (static) file from inside a Python package?



            When I Read The Fine Manual, this setup.cfg alternative surfaces:



            [options.data_files]
            ...
            data = data/img/logo.png, data/svg/icon.svg


            suggesting a line like . = champs/num_Uname.json or champs = num_Uname.json







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 27 at 2:56

























            answered Mar 27 at 2:50









            J_HJ_H

            5,6151923




            5,6151923












            • Thank you for your answer and insight, I wish I could also give you a bounty reward as well but Augusto A has already answered before you

              – KowaiiNeko
              Mar 27 at 3:55


















            • Thank you for your answer and insight, I wish I could also give you a bounty reward as well but Augusto A has already answered before you

              – KowaiiNeko
              Mar 27 at 3:55

















            Thank you for your answer and insight, I wish I could also give you a bounty reward as well but Augusto A has already answered before you

            – KowaiiNeko
            Mar 27 at 3:55






            Thank you for your answer and insight, I wish I could also give you a bounty reward as well but Augusto A has already answered before you

            – KowaiiNeko
            Mar 27 at 3:55


















            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55330280%2fincluding-folder-and-files-inside-a-python-package%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript